https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113875

            Bug ID: 113875
           Summary: g++ crash with Internal Compiler Error when compiling
                    HotSpot for Windows with -Os and -flto
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tanksherman27 at gmail dot com
  Target Milestone: ---

When compiling the Java HotSpot VM for Windows, g++ crashes with an Internal
Compiler Error if the optimization level is set to SIZE (Aka -Os):

during GIMPLE pass: dse
src/hotspot/share/runtime/continuationFreezeThaw.cpp: In function
'freeze_epilog.isra':
src/hotspot/share/runtime/continuationFreezeThaw.cpp:1544:12: internal compiler
error: in binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:383:
C:\msys64\tmp\cc602ZS3.ltrans127.ltrans.o] Error 1
make[4]: *** Waiting for unfinished jobs....
during GIMPLE pass: dse
ad_x86_gen.cpp: In member function 'MachNodeGenerator':
ad_x86_gen.cpp:508:11: internal compiler error: in binds_to_current_def_p, at
symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:41:
C:\msys64\tmp\cc602ZS3.ltrans13.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp: In function 'details.isra':
src/hotspot/share/gc/g1/g1GCPhaseTimes.cpp:312:6: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:377:
C:\msys64\tmp\cc602ZS3.ltrans125.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/classfile/verifier.cpp: In member function
'get_newarray_type.isra':
src/hotspot/share/classfile/verifier.cpp:3003: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:371:
C:\msys64\tmp\cc602ZS3.ltrans123.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp: In function
'fill_continuation_entry.constprop':
src/hotspot/cpu/x86/sharedRuntime_x86_64.cpp:1326: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:368:
C:\msys64\tmp\cc602ZS3.ltrans122.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/prims/jni.cpp: In function 'jni_MonitorEnter':
src/hotspot/share/prims/jni.cpp:2712: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:191:
C:\msys64\tmp\cc602ZS3.ltrans63.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/cpu/x86/c1_Runtime1_x86.cpp: In member function
'restore_live_registers_except_rax.constprop':
src/hotspot/cpu/x86/c1_Runtime1_x86.cpp:568:6: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
during GIMPLE pass: dse
src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp: In member function
'addm.constprop':
src/hotspot/cpu/x86/macroAssembler_x86_sha.cpp:670: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:365:
C:\msys64\tmp\cc602ZS3.ltrans121.ltrans.o] Error 1
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:362:
C:\msys64\tmp\cc602ZS3.ltrans120.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp: In member function
'steal_and_trim_queue':
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:322:6: internal compiler
error: in binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:152:
C:\msys64\tmp\cc602ZS3.ltrans50.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/opto/loopTransform.cpp: In member function
'do_range_check.isra':
src/hotspot/share/opto/loopTransform.cpp:2862: internal compiler error: in
binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:374:
C:\msys64\tmp\cc602ZS3.ltrans124.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp: In member function
'do_nmethod':
src/hotspot/share/gc/shenandoah/shenandoahConcurrentGC.cpp:850: internal
compiler error: in binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:293:
C:\msys64\tmp\cc602ZS3.ltrans97.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/gc/shared/gcTraceTime.inline.hpp: In member function '__ct
.constprop':
src/hotspot/share/gc/shared/gcTraceTime.inline.hpp:187: internal compiler
error: in binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:356:
C:\msys64\tmp\cc602ZS3.ltrans118.ltrans.o] Error 1
during GIMPLE pass: dse
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp: In member function
'trim_queue_to_threshold':
src/hotspot/share/gc/g1/g1ParScanThreadState.cpp:307:6: internal compiler
error: in binds_to_current_def_p, at symtab.cc:2497
libbacktrace could not find executable to open
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://github.com/msys2/MINGW-packages/issues> for instructions.
make[4]: *** [C:\msys64\tmp\ccxx3n9d.mk:149:
C:\msys64\tmp\cc602ZS3.ltrans49.ltrans.o] Error 1
lto-wrapper.exe: fatal error: make returned 2 exit status
compilation terminated.
C:/msys64/ucrt64/lib/gcc/x86_64-w64-mingw32/13.2.0/../../../../x86_64-w64-mingw32/bin/ld.exe:
error: lto-wrapper failed
collect2.exe: error: ld returned 1 exit status

The compiled methods in HotSpot that g++ crashes on are different every time,
so I didn't include them here (There are way too many of them too). The linker
command line for linking it is:

/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/fixpath
-m exec /ucrt64/bin/g++.exe -Wl,--no-undefined -fno-stack-protector
-Wl,--exclude-all-symbols -Wl,--subsystem,windows -m64 -static-libstdc++
-static-libgcc -shared -Os -flto=15 -fuse-linker-plugin -fno-strict-aliasing
-m64
-Wl,-version-script=/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/hotspot/variant-server/libjvm/mapfile
-Wl,--pdb=/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/support/modules_libs/java.base/server/jvm.dll.pdb
-Wl,-soname=jvm.dll -o
/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/support/modules_libs/java.base/server/jvm.dll
@/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/hotspot/variant-server/libjvm/objects/_BUILD_LIBJVM_objectfilenames.txt
/c/users/vertig0/downloads/eclipse-committers-2023-12-r-win32-x86_64/workspace/jdk/build/windows-x86_64-server-release/hotspot/variant-server/libjvm/objects/jvm.dll.res
-lpowrprof -lws2_32 -lwinmm -lversion -lpsapi

(fixpath is merely a wrapper for converting Windows paths to Unix paths, and
shouldn't matter)

Reply via email to