View Issue Details

IDProjectCategoryView StatusLast Update
0000431GCC - GNU C CompilerBugpublic2022-05-14 16:34
Reporterherbthompson Assigned Topsmedley  
Status closedResolutionfixed 
PlatformWarp 4 
Summary0000431: Inconsitencies between gcc and g++ (
Description(1) For a given C++ program, the executable produced by g++ is much larger than the executable produced by gcc -- e.g. 270 kB versue 12 kB.

(2) When EMXOMFLD_TYPE=WLINK and EMXOMFLD_LINKER=WL, "gcc --std=c++0x name.cpp -s -Zomf" appears to staticly link gcc444 even if "-static-libgcc" is NOT set -- i.e. the EXE will run on a machine without gcc444.dll (and the size of the execuatbles produced by gcc are the same with and without "-staic-libgcc"). If EMXOMFLD_TYPE=LINK386 and EMXOMFLD_LINKER=LINK386, the excuatble produced by gcc will depend on gcc444.dll unless "-staic-libgcc" is specified.

(3) LINK386 will crash when (indirectly) invoked by "g++ --std=c++0x name.cpp -s -static-libgcc -Zomf" but not when invoked by gcc with the same parameters.

(4) In some cases emxomf reports warnings when a program is built with g++ but not when built by gcc using the same options -- e.g. "g++ --std=c++0x name.cpp -s -Zomf" results in emxomf warnings but "gcc --std=c++0x name.cpp -s -Zomf" does not.

(5) When EMXOMFLD_TYPE=LINK386 and EMXOMFLD_LINKER=LINK386, the exe produced by "g++ --std=c++0x name.cpp -s -Zomf" won't run but if the program is built with gcc using the same options the exe will run.
Steps To ReproduceThese observations can be reproduced as follows:

--- forlist.cpp ---
#include <forward_list>
#include <iostream>
#include <string>
using namespace std;

int main()
    forward_list<string> list;
    for (auto itr=list.begin(); itr!=list.end(); itr++) cout << *itr << endl;
--- ~~~ ---

--- build.cmd --- (See the attached build.cmd file)
del *.err
del forlist*.exe

gcc --std=c++0x -o forlist-gcc-shared-out.exe forlist.cpp -s 2> gcc-shared-out.err
gcc --std=c++0x -o forlist-gcc-static-out.exe forlist.cpp -s -static-libgcc 2> gcc-static-out.err

g++ --std=c++0x -o forlist-g++-shared-out.exe forlist.cpp -s 2> g++-shared-out.err
g++ --std=c++0x -o forlist-g++-static-out.exe forlist.cpp -s -static-libgcc 2> g++-static-out.err


gcc --std=c++0x -o forlist-gcc-shared-omf-wl.exe forlist.cpp -s -Zomf 2> gcc-shared-omf-wl.err
gcc --std=c++0x -o forlist-gcc-static-omf-wl.exe forlist.cpp -s -static-libgcc -Zomf 2> gcc-static-omf-wl.err

g++ --std=c++0x -o forlist-g++-shared-omf-wl.exe forlist.cpp -s -Zomf 2> g++-shared-omf-wl.err
g++ --std=c++0x -o forlist-g++-static-omf-wl.exe forlist.cpp -s -static-libgcc -Zomf 2> g++-static-omf-wl.err


gcc --std=c++0x -o forlist-gcc-shared-omf-386.exe forlist.cpp -s -Zomf 2> gcc-shared-omf-386.err
gcc --std=c++0x -o forlist-gcc-static-omf-386.exe forlist.cpp -s -static-libgcc -Zomf 2> gcc-static-omf-386.err

g++ --std=c++0x -o forlist-g++-shared-omf-386.exe forlist.cpp -s -Zomf 2> g++-shared-omf-386.err
g++ --std=c++0x -o forlist-g++-static-omf-386.exe forlist.cpp -s -static-libgcc -Zomf 2> g++-static-omf-386.err
--- ~~~ ---

2010/07/12 07:29 PM 249,856 forlist-g++-shared-omf-386.exe
2010/07/12 07:26 PM 267,148 forlist-g++-shared-omf-wl.exe
2010/07/12 07:24 PM 270,340 forlist-g++-shared-out.exe
2010/07/12 07:27 PM 277,924 forlist-g++-static-omf-wl.exe
2010/07/12 07:24 PM 294,916 forlist-g++-static-out.exe
2010/07/12 07:28 PM 5,632 forlist-gcc-shared-omf-386.exe
2010/07/12 07:25 PM 4,916 forlist-gcc-shared-omf-wl.exe
2010/07/12 07:24 PM 12,292 forlist-gcc-shared-out.exe
2010/07/12 07:28 PM 11,264 forlist-gcc-static-omf-386.exe
2010/07/12 07:26 PM 4,916 forlist-gcc-static-omf-wl.exe
2010/07/12 07:24 PM 16,388 forlist-gcc-static-out.exe
TagsNo tags attached.
Attached Files
build.cmd (1,491 bytes)



2022-05-14 16:33

administrator   ~0004274

Please retest wiht a supported GCC

Issue History

Date Modified Username Field Change
2010-07-13 09:56 herbthompson New Issue
2010-07-13 09:56 herbthompson File Added: build.cmd
2022-05-14 16:33 psmedley Assigned To => psmedley
2022-05-14 16:33 psmedley Status new => resolved
2022-05-14 16:33 psmedley Resolution open => fixed
2022-05-14 16:33 psmedley Note Added: 0004274
2022-05-14 16:34 psmedley Status resolved => closed