Bug 60865 - ICE: verify_cgraph_node failed: comdat-local function called by <built-in> outside its comdat with -fdeclone-ctor-dtor
Summary: ICE: verify_cgraph_node failed: comdat-local function called by <built-in> ou...
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: ipa (show other bugs)
Version: 5.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-checking, ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2014-04-16 19:05 UTC by Zdenek Sojka
Modified: 2021-09-16 10:08 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 5.5.0, 6.5.0, 7.5.0, 8.5.0
Known to fail: 4.9.4, 5.3.1, 6.0
Last reconfirmed: 2014-04-17 00:00:00


Attachments
partially reduced testcase (370 bytes, text/x-csrc)
2014-04-16 19:05 UTC, Zdenek Sojka
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2014-04-16 19:05:09 UTC
Created attachment 32619 [details]
partially reduced testcase

Compiler output:
$ gcc -O3 -fdeclone-ctor-dtor --param=ipa-cp-eval-threshold=1 testcase.C
testcase.C:48:1: error: comdat-local function called by <built-in> outside its comdat
 }
 ^
_ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC4Ev/9 (Serializer<unsigned int, Loki::Typelist<int, Loki::Typelist<ClassSpec<unsigned int, int, 40u>, Loki::NullType> > >::Serializer()) @0x7ff5dd0ee520
  Type: function definition analyzed
  Visibility: prevailing_def_ironly comdat_group:_ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC5Ev one_only artificial
  Same comdat group as: _ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC2Ev/10
  References: _ZTT10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEE/15 (addr)_ZTV10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEE/14 (addr)_ZTV10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEE/14 (addr)
  Referring: 
  Availability: local
  First run: 0
  Function flags: body local
  Called by: _ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC1Ev.constprop.0/44 (1.00 per call) _ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC1Ev/11 (1.00 per call) _ZN10SerializerIjN4Loki8TypelistIiNS1_I9ClassSpecIjiLj40EENS0_8NullTypeEEEEEEC2Ev/10 (1.00 per call) 
  Calls: 
testcase.C:48:1: internal compiler error: verify_cgraph_node failed
0x934d8f verify_cgraph_node(cgraph_node*)
        /mnt/svn/gcc-trunk/gcc/cgraph.c:2997
0x93001e verify_symtab_node(symtab_node*)
        /mnt/svn/gcc-trunk/gcc/symtab.c:882
0x930057 verify_symtab()
        /mnt/svn/gcc-trunk/gcc/symtab.c:899
0xb29a21 symtab_remove_unreachable_nodes(bool, _IO_FILE*)
        /mnt/svn/gcc-trunk/gcc/ipa.c:308
0xbfc147 execute_todo
        /mnt/svn/gcc-trunk/gcc/passes.c:1896
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.

$ gcc -v                                                                
Using built-in specs.
COLLECT_GCC=/mnt/svn/gcc-trunk/binary-latest/bin/gcc
COLLECT_LTO_WRAPPER=/mnt/svn/gcc-trunk/binary-209399-lto-fortran-checking-yes-rtl-df/libexec/gcc/x86_64-unknown-linux-gnu/4.10.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: /mnt/svn/gcc-trunk//configure --enable-checking=yes,rtl,df --enable-languages=c,c++,lto,fortran --prefix=/mnt/svn/gcc-trunk/binary-209399-lto-fortran-checking-yes-rtl-df/ --without-cloog --without-ppl
Thread model: posix
gcc version 4.10.0 20140415 (experimental) (GCC)
Comment 1 Richard Biener 2014-04-17 11:04:28 UTC
Confirmed.  4.8 doesn't have -fdeclone-ctor-ctor.
Comment 2 VdP 2018-04-06 08:50:43 UTC
See https://bugs.gentoo.org/640010 which has another reduced testcase and affects libreoffice -Os builds. It looks like the same bug to me, but maybe I'm wrong ?
Comment 3 Andrew Pinski 2021-09-16 00:57:56 UTC
This looks like it was fixed on the trunk.  Also it was only ICE with checking so it is going to be hard to figure out where it was fixed.
Comment 4 Zdenek Sojka 2021-09-16 10:08:44 UTC
I can't reproduce this any more on gcc-5.5.0 or newer, even with enabled checking:

$ x86_64-pc-linux-gnu-gcc -v
Using built-in specs.
COLLECT_GCC=/repo/gcc-5-branch/binary-latest-amd64/bin/x86_64-pc-linux-gnu-gcc
COLLECT_LTO_WRAPPER=/repo/gcc-5-branch/binary-5-branch-20171010081101-g926d9947847-checking-yes-rtl-df-nographite-amd64/bin/../libexec/gcc/x86_64-pc-linux-gnu/5.5.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /repo/gcc-5-branch//configure --enable-languages=c,c++ --disable-nls --enable-checking=yes,rtl,df --without-cloog --without-ppl --without-isl --build=x86_64-pc-linux-gnu --host=x86_64-pc-linux-gnu --target=x86_64-pc-linux-gnu --with-ld=/usr/bin/x86_64-pc-linux-gnu-ld --with-as=/usr/bin/x86_64-pc-linux-gnu-as --disable-libsanitizer --disable-libstdcxx-pch --prefix=/repo/gcc-5-branch//binary-5-branch-20171010081101-g926d9947847-checking-yes-rtl-df-nographite-amd64
Thread model: posix
gcc version 5.5.0 (GCC) 

$ x86_64-pc-linux-gnu-gcc -O3 -fdeclone-ctor-dtor --param=ipa-cp-eval-threshold=1 testcase.C -c
(no output)