public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
@ 2022-06-27 11:55 ivanka2012 at gmail dot com
  2022-06-29 10:15 ` [Bug lto/106103] " ivanka2012 at gmail dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: ivanka2012 at gmail dot com @ 2022-06-27 11:55 UTC (permalink / raw)
  To: 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&action=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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug lto/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
  2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
@ 2022-06-29 10:15 ` ivanka2012 at gmail dot com
  2023-01-14 11:14 ` [Bug tree-optimization/106103] " ivanka2012 at gmail dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ivanka2012 at gmail dot com @ 2022-06-29 10:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Ivan <ivanka2012 at gmail dot com> ---
Created attachment 53225
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53225&action=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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
  2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
  2022-06-29 10:15 ` [Bug lto/106103] " ivanka2012 at gmail dot com
@ 2023-01-14 11:14 ` ivanka2012 at gmail dot com
  2023-07-20 18:50 ` ivanka2012 at gmail dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: ivanka2012 at gmail dot com @ 2023-01-14 11:14 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Ivan <ivanka2012 at gmail dot com> ---
Putting -fno-declone-ctor-dtor in the flags "fixes" the bug.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
  2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
  2022-06-29 10:15 ` [Bug lto/106103] " ivanka2012 at gmail dot com
  2023-01-14 11:14 ` [Bug tree-optimization/106103] " ivanka2012 at gmail dot com
@ 2023-07-20 18:50 ` ivanka2012 at gmail dot com
  2024-02-11 16:12 ` tanksherman27 at gmail dot com
  2024-02-11 16:57 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: ivanka2012 at gmail dot com @ 2023-07-20 18:50 UTC (permalink / raw)
  To: gcc-bugs

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

Ivan <ivanka2012 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |11.3.0
      Known to fail|11.3.0                      |13.1.0

--- Comment #3 from Ivan <ivanka2012 at gmail dot com> ---
It seems like commit 5a1ef1cfac005370d0a5a0f85798724cb2c9cf5e (Analyze SRA
candidates in ipa-fnsummary) somehow fixes this bug in master...

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
  2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
                   ` (2 preceding siblings ...)
  2023-07-20 18:50 ` ivanka2012 at gmail dot com
@ 2024-02-11 16:12 ` tanksherman27 at gmail dot com
  2024-02-11 16:57 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: tanksherman27 at gmail dot com @ 2024-02-11 16:12 UTC (permalink / raw)
  To: gcc-bugs

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

Julian Waters <tanksherman27 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tanksherman27 at gmail dot com

--- Comment #4 from Julian Waters <tanksherman27 at gmail dot com> ---
The Java HotSpot VM also cannot currently be compiled for Windows with
optimization level SIZE and Link Time Optimization active due to this bug

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug tree-optimization/106103] ICE in binds_to_current_def_p when source object files are compiled with -flto -Os
  2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
                   ` (3 preceding siblings ...)
  2024-02-11 16:12 ` tanksherman27 at gmail dot com
@ 2024-02-11 16:57 ` pinskia at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-11 16:57 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 113875 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-11 16:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-27 11:55 [Bug lto/106103] New: ICE in binds_to_current_def_p when source object files are compiled with -flto -Os ivanka2012 at gmail dot com
2022-06-29 10:15 ` [Bug lto/106103] " ivanka2012 at gmail dot com
2023-01-14 11:14 ` [Bug tree-optimization/106103] " ivanka2012 at gmail dot com
2023-07-20 18:50 ` ivanka2012 at gmail dot com
2024-02-11 16:12 ` tanksherman27 at gmail dot com
2024-02-11 16:57 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).