[Bug lto/113875] g++ crash with Internal Compiler Error when compiling HotSpot for Windows with -Os and -flto

2024-02-11 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113875

Ivan  changed:

   What|Removed |Added

 CC||ivanka2012 at gmail dot com

--- Comment #4 from Ivan  ---
Also a dupe of 106103

[Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os

2023-07-20 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103

Ivan  changed:

   What|Removed |Added

  Known to work||11.3.0
  Known to fail|11.3.0  |13.1.0

--- Comment #3 from Ivan  ---
It seems like commit 5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e (Analyze SRA
candidates in ipa-fnsummary) somehow fixes this bug in master...

[Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os

2023-01-14 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103

--- Comment #2 from Ivan  ---
Putting -fno-declone-ctor-dtor in the flags "fixes" the bug.

[Bug ipa/108383] g++ ICE with -O3 and -flto and -fdeclone-ctor-dtor on simple function

2023-01-14 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108383

Ivan  changed:

   What|Removed |Added

 CC||ivanka2012 at gmail dot com

--- Comment #5 from Ivan  ---
This is related to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103

[Bug lto/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os

2022-06-29 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103

--- Comment #1 from Ivan  ---
Created attachment 53225
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53225=edit
Single file and smaller version of the original testcase

To compile this, do:
x86_64-w64-mingw32-g++ -r -flto -Os -std=gnu++14 -o /dev/null full.ii
-lkernel32

[Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os

2022-06-27 Thread ivanka2012 at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106103

Bug ID: 106103
   Summary: ICE in binds_to_current_def_p when source object files
are compiled with -flto -Os
   Product: gcc
   Version: 12.1.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: lto
  Assignee: unassigned at gcc dot gnu.org
  Reporter: ivanka2012 at gmail dot com
CC: marxin at gcc dot gnu.org
  Target Milestone: ---
  Host: x86_64-build_pc-linux-gnu
Target: x86_64-w64-mingw32
 Build: x86_64-build_pc-linux-gnu

Created attachment 53209
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53209=edit
Source code that contains alc.cpp.ii, buffer.cpp.ii and openal-info.c.i

Compile the attached source files in the archive with the following commands:
x86_64-w64-mingw32-g++ -flto -Os -std=gnu++14 -o alc.o -c alc.cpp.ii
x86_64-w64-mingw32-g++ -flto -Os -std=gnu++14 -o buffer.o -c buffer.cpp.ii
x86_64-w64-mingw32-gcc -flto -Os -std=gnu11 -o openal-info.o -c openal-info.c.i
x86_64-w64-mingw32-g++ -r openal-info.o buffer.o alc.o -o /dev/null -lkernel32

The linker will yield the following:
during GIMPLE pass: dse
alc.cpp.ii: In function 'alcGetString':
alc.cpp.ii:1167:13: internal compiler error: in binds_to_current_def_p, at
symtab.cc:2494
 1167 | const char *alcGetString() try {
  | ^
0x681fd1 symtab_node::binds_to_current_def_p(symtab_node*)
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/symtab.cc:2494
0xc5a980 ref_maybe_used_by_call_p_1
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-alias.cc:2804
0xc5c137 ref_maybe_used_by_call_p
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-alias.cc:2929
0xc5c137 ref_maybe_used_by_stmt_p(gimple*, ao_ref*, bool)
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-alias.cc:2961
0xc7e517 dse_classify_store(ao_ref*, gimple*, bool, simple_bitmap_def*, bool*,
tree_node*)
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-dse.cc:981
0xc7ff76 dse_optimize_stmt
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-dse.cc:1385
0xc7ff76 execute
   
/x/crosstool-ng/.build/x86_64-w64-mingw32/src/gcc/gcc/tree-ssa-dse.cc:1491

The compiler is configured with the following flags:
--build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu
--target=x86_64-w64-mingw32 --prefix=/prefix --exec_prefix=/prefix
--with-sysroot=/prefix/x86_64-w64-mingw32/sysroot
--enable-languages=c,c++,fortran --with-pkgversion='crosstool-NG
1.25.0.40_994767d' --disable-shared --enable-__cxa_atexit --disable-libmudflap
--disable-libgomp --disable-libssp --disable-libquadmath
--disable-libquadmath-support --disable-libsanitizer --disable-libmpx
--disable-libstdcxx-verbose
--with-gmp=/x/crosstool-ng/.build/x86_64-w64-mingw32/buildtools
--with-mpfr=/x/crosstool-ng/.build/x86_64-w64-mingw32/buildtools
--with-mpc=/x/crosstool-ng/.build/x86_64-w64-mingw32/buildtools
--with-isl=/x/crosstool-ng/.build/x86_64-w64-mingw32/buildtools --enable-lto
--enable-threads=posix --enable-target-optspace --enable-plugin --disable-nls
--enable-multiarch --with-local-prefix=/prefix/x86_64-w64-mingw32/sysroot
--enable-long-long
However, this was supplied by crosstool-ng, which I used to compile the
toolchain. You might need to use that instead.
The toolchain can be compiled with crosstool-ng using the following:
./ct-ng x86_64-w64-mingw32
./ct-ng build
I also set the prefix to something more reasonable and all compiler and linker
flags were set to be '-g' but nothing else.

Notes:
This is already the most minimal possible test case. I tried fiddling with the
compiler and linker flags and the above combination is the most minimal one
that produces the ICE. The source code has also been processed with cvise for
several days.
I also observed this ICE in the "alias" GIMPLE pass in other test cases that
are not included here since I haven't reduced those.