View Issue Details

IDProjectCategoryView StatusLast Update
0000468GCC - GNU C CompilerBugpublic2013-06-08 02:30
ReporterdmikAssigned To 
Status newResolutionopen 
Product Version 
Target VersionFixed in Version 
Summary0000468: GCC 4.4.4/4.4.5 fail to write to .S
DescriptionI found that the specified GCC versions fail to write to the .S file when compiling certain .cpp files. Here is the error message:

d:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp:302: fatal error: error writing to D:\Temp/ccuhk8h8.s: Invalid
compilation terminated.

The command line was as follows:

g++ -DIA32 -D__WIN32OS2__ -D__i386__ -DSTRICT -D_POSIX_SOURCE -D_POSIX_C_SOURCE=200112 -D_EMX_SOURCE -D_XOPEN_SOURCE=600 -D_SVID_SOURCE -ID:/Coding/odin32/include/Win -ID:/Coding/odin32/include -DASSERT -DDEBUG -D_DEBUG -DCOMPILER2 -D'HOTSPOT_RELEASE_VERSION="16.0-b13"' -D'JRE_RELEASE_VERSION="1.6.0-rc-debug-b19"' -D'HOTSPOT_LIB_ARCH="i386"' -D'HOTSPOT_BUILD_TARGET="debug"' -D'HOTSPOT_BUILD_USER="dmik"' -D'HOTSPOT_VM_DISTRO="OpenJDK"' -DOS2 -DVM_LITTLE_ENDIAN -D_JNI_IMPLEMENTATION_ -I../generated -I'../generated/incls' -I'../generated/jvmtifiles' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/c1' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/compiler' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/code' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/interpreter' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/ci' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/classfile' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/parallelScavenge' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/shared' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/parNew' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/g1' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_interface' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/asm' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/memory' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/oops' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/prims' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/runtime' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/services' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/utilities' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/libadt' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/opto' -I'd:/Coding/javaos2/openjdk/hotspot/src/os/windows/vm' -I'd:/Coding/javaos2/openjdk/hotspot/src/os/os2/vm' -I'd:/Coding/javaos2/openjdk/hotspot/src/os_cpu/windows_x86/vm' -I'd:/Coding/javaos2/openjdk/hotspot/src/os_cpu/os2_x86/vm' -I'd:/Coding/javaos2/openjdk/hotspot/src/cpu/x86/vm' -I'd:/Coding/javaos2/openjdk/hotspot/src/share/vm/opto' -Zomf -march=i486 -mtune=generic -Wno-sign-compare -Wno-write-strings -c d:/Coding/javaos2/openjdk/hotspot/src/share/vm/gc_implementation/concurrentMarkSweep/cmsGCAdaptivePolicyCounters.cpp -o cmsGCAdaptivePolicyCounters.obj -v
Additional InformationNote the following:

1. Removing -g (debug info) from the command line solves the problem.
2. The problem does not show up in GCC 4.4.2 and GCC 4.5.2.
3. Changing -c to -S (i.e. just generate the assembly) demonstrates exactly the same problem except that the name of the output file is different.
4. Preprocessing the file with -E and then compiling the result with -c or with -S solves the problem too. Which means it only appears when preprocessing is done as part of the command.

I also recall that we had the very same problem with GCC 3.4.x and Qt and we solved it by switching to GCC 4.4.2 back then (which works well in this case now too). So maybe this is a good hint for you.

Giving this bug and bug 0000467, there is a situation that we don't have a completely working GCC set now that could build both release and debug of OpenJDK and where C++ exceptions would work. So fixing these two bugs looks like a really important thing to me.
TagsNo tags attached.



2011-03-06 02:25

reporter   ~0001849

BTW, it actually happens with 4.4.2 as well, but on a different file... Also -g is guilty. 4.5.2 works well on all failed files.


2011-03-07 20:59

administrator   ~0001851

got a sample file I can use to test/debug with?


2011-03-09 02:58

reporter   ~0001852

I don't have such a sample file ATM and don't know how to obtain it.

You may use the OpenJDK SVN as a sample. It's simpler than you think. Just check it out, setup the env according to README, establish it with the supplied env.cmd, and run the above g++ command from this env.


2011-03-12 00:14

reporter   ~0001855

Actually, I don't think you even need to do any env. setup besides GCC itself. Just going to a directory 'D:/Coding/javaos2/openjdk/bould/os2-i586-debug/hotspot/outputdir/os2_i486_compiler1/debug' and executing the above GCC command from there should do the trick. You will have to create this directory by hand if you don't run the full make cycle -- it is necessary to stay there to correctly resolve relative paths specified on the GCC command line.


2011-03-12 00:15

reporter   ~0001856

D:/Coding/javaos2 is where you check out the Java SVN.


2011-12-31 19:01

administrator   ~0002108

still an issue?


2012-02-20 21:04

reporter   ~0002219

Yes. Fine in the release build, and exactly the same error when -g is used. But the file is different this time: templateTable.cpp. I will have to debug and fix that...

GCC is the latest 4.4.6 RPM.


2013-06-08 02:30

reporter   ~0002457

JFYI, there is a ticket with more GCC problems here:

Issue History

Date Modified Username Field Change
2011-03-06 00:04 dmik New Issue
2011-03-06 02:25 dmik Note Added: 0001849
2011-03-07 20:59 psmedley Note Added: 0001851
2011-03-09 02:58 dmik Note Added: 0001852
2011-03-12 00:14 dmik Note Added: 0001855
2011-03-12 00:15 dmik Note Added: 0001856
2011-12-31 19:01 psmedley Note Added: 0002108
2012-02-20 21:04 dmik Note Added: 0002219
2013-06-08 02:30 dmik Note Added: 0002457