On x86-64, when building 483.xalancbmk in SPEC CPU 2006, r273791 caused: $ g++ -m32 -Ofast -funroll-loops -msse2 -mfpmath=sse -ffast-math -march=skylake-avx512 -flto ... ElemNumber.cpp: In member function 'getCountString': ElemNumber.cpp:458:1: internal compiler error: Segmentation fault 458 | ElemNumber::getCountString( | ^ Please submit a full bug report, with preprocessed source if appropriate. See <https://gcc.gnu.org/bugs/> for instructions. lto-wrapper: fatal error: g++ returned 1 exit status compilation terminated. /usr/local/bin/ld: error: lto-wrapper failed collect2: error: ld returned 1 exit status specmake: *** [Xalan] Error 1
Mine.
Reduced test-case: $ cat ice.cpp struct Base { virtual ~Base(); }; struct Derived : Base { void operator delete(void *) {} }; void foo() { Derived d1; } $ gcc -O3 -c -fno-ipa-pure-const -fipa-sra -fno-early-inlining ice.cpp during GIMPLE pass: cddce ice.cpp: In destructor ‘virtual Derived::~Derived()’: ice.cpp:7:26: internal compiler error: in gimple_call_arg, at gimple.h:3190 7 | void foo() { Derived d1; } | ^ 0x13198ce gimple_call_arg /home/marxin/Programming/gcc/gcc/gimple.h:3190 0x1319924 gimple_call_arg /home/marxin/Programming/gcc/gcc/gimple.h:3198 0x131c76a propagate_necessity /home/marxin/Programming/gcc/gcc/tree-ssa-dce.c:813 0x131f0b1 perform_tree_ssa_dce /home/marxin/Programming/gcc/gcc/tree-ssa-dce.c:1663 0x131f1f3 tree_ssa_cd_dce /home/marxin/Programming/gcc/gcc/tree-ssa-dce.c:1707 0x131f360 execute /home/marxin/Programming/gcc/gcc/tree-ssa-dce.c:1772 I've got a patch candidate for it.
Another way to generate the same crash is to compile file gcc testsuite file g++.old-deja/g++.oliva/new1.C with compiler flag -O2. during GIMPLE pass: cddce ./g++.old-deja/g++.oliva/new1.C: In function â<80><98>int main()â<80><99>: ./g++.old-deja/g++.oliva/new1.C:20:43: internal compiler error: in gimple_call_arg, at gimple.h:3190
*** Bug 91350 has been marked as a duplicate of this bug. ***
Author: marxin Date: Mon Aug 5 12:53:01 2019 New Revision: 274115 URL: https://gcc.gnu.org/viewcvs?rev=274115&root=gcc&view=rev Log: Handle new operators with no arguments in DCE. 2019-08-05 Martin Liska <mliska@suse.cz> PR c++/91334 * tree-ssa-dce.c (propagate_necessity): Handle new operators with not arguments. (eliminate_unnecessary_stmts): Likewise. 2019-08-05 Martin Liska <mliska@suse.cz> PR c++/91334 * g++.dg/torture/pr91334.C: New test. Added: trunk/gcc/testsuite/g++.dg/torture/pr91334.C Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-ssa-dce.c
Should be fixed now.
r274135 gave: ./PlatformDefinitions.hpp:66:35: internal compiler error: Segmentation fault 66 | #define XALAN_CPP_NAMESPACE_END } | ^ 0xfbc09f crash_signal ../../src-trunk/gcc/toplev.c:326 0xb26383 lookup_page_table_entry ../../src-trunk/gcc/ggc-page.c:632 0xb26383 ggc_set_mark(void const*) ../../src-trunk/gcc/ggc-page.c:1531 0xd69c41 gt_ggc_mx_symtab_node(void*) /export/gnu/import/git/gcc-test-spec-lto/bld/gcc/gtype-desc.c:1302 0xee468d gt_ggc_ma_order ./gt-passes.h:31 0xee468d gt_ggc_ma_order ./gt-passes.h:26 0xcf6115 ggc_mark_root_tab ../../src-trunk/gcc/ggc-common.c:77 0xcf631c ggc_mark_roots() ../../src-trunk/gcc/ggc-common.c:94 0xb26d05 ggc_collect() ../../src-trunk/gcc/ggc-page.c:2201 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
Can you please provide both compiler options used and a test-case?
[hjl@gnu-mic-1 build_base_lto.0000]$ /export/gnu/import/git/gcc-test-spec-lto/usr/bin/g++ -S -DSPEC_CPU -DNDEBUG -DAPP_NO_THREADS -DXALAN_INMEM_MSG_LOADER -I. -Ixercesc -Ixercesc/dom -Ixercesc/dom/impl -Ixercesc/sax -Ixercesc/util/MsgLoaders/InMemory -Ixercesc/util/Transcoders/Iconv -Ixalanc/include -DPROJ_XMLPARSER -DPROJ_XMLUTIL -DPROJ_PARSERS -DPROJ_SAX4C -DPROJ_SAX2 -DPROJ_DOM -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER -O2 -DSPEC_CPU_LP64 -DSPEC_CPU_LINUX XPath.cpp -ffast-math In file included from ./XPathDefinitions.hpp:21, from XPath.hpp:22, from XPath.cpp:18: XPath.cpp: In member function ‘void xalanc_1_8::XPath::executeMore(xalanc_1_8::XalanNode*, xalanc_1_8::XPath::OpCodeMapPositionType, xalanc_1_8::XPathExecutionContext&, xalanc_1_8::FormatterListener&, xalanc_1_8::XPath::MemberFunctionPtr) const’: ./PlatformDefinitions.hpp:66:35: internal compiler error: Segmentation fault 66 | #define XALAN_CPP_NAMESPACE_END } | ^ XPath.cpp:5696:1: note: in expansion of macro ‘XALAN_CPP_NAMESPACE_END’ 5696 | XALAN_CPP_NAMESPACE_END | ^~~~~~~~~~~~~~~~~~~~~~~ 0xfbcc0f crash_signal ../../src-trunk/gcc/toplev.c:326 0xb26b73 lookup_page_table_entry ../../src-trunk/gcc/ggc-page.c:632 0xb26b73 ggc_set_mark(void const*) ../../src-trunk/gcc/ggc-page.c:1531 0xd6a781 gt_ggc_mx_symtab_node(void*) /export/gnu/import/git/gcc-test-spec-lto/bld/gcc/gtype-desc.c:1302 0xee51fd gt_ggc_ma_order ./gt-passes.h:31 0xee51fd gt_ggc_ma_order ./gt-passes.h:26 0xcf6995 ggc_mark_root_tab ../../src-trunk/gcc/ggc-common.c:77 0xcf6b9c ggc_mark_roots() ../../src-trunk/gcc/ggc-common.c:94 0xb274f5 ggc_collect() ../../src-trunk/gcc/ggc-page.c:2201 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. [hjl@gnu-mic-1 build_base_lto.0000]$ -O2 -ffast-math is needed to trigger ICE.
(In reply to H.J. Lu from comment #9) > [hjl@gnu-mic-1 build_base_lto.0000]$ > /export/gnu/import/git/gcc-test-spec-lto/usr/bin/g++ -S -DSPEC_CPU -DNDEBUG > -DAPP_NO_THREADS -DXALAN_INMEM_MSG_LOADER -I. -Ixercesc -Ixercesc/dom > -Ixercesc/dom/impl -Ixercesc/sax -Ixercesc/util/MsgLoaders/InMemory > -Ixercesc/util/Transcoders/Iconv -Ixalanc/include -DPROJ_XMLPARSER > -DPROJ_XMLUTIL -DPROJ_PARSERS -DPROJ_SAX4C -DPROJ_SAX2 -DPROJ_DOM > -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER > -O2 -DSPEC_CPU_LP64 -DSPEC_CPU_LINUX XPath.cpp -ffast-math > In file included from ./XPathDefinitions.hpp:21, > from XPath.hpp:22, > from XPath.cpp:18: > XPath.cpp: In member function ‘void > xalanc_1_8::XPath::executeMore(xalanc_1_8::XalanNode*, > xalanc_1_8::XPath::OpCodeMapPositionType, > xalanc_1_8::XPathExecutionContext&, xalanc_1_8::FormatterListener&, > xalanc_1_8::XPath::MemberFunctionPtr) const’: > ./PlatformDefinitions.hpp:66:35: internal compiler error: Segmentation fault > 66 | #define XALAN_CPP_NAMESPACE_END } > | ^ > XPath.cpp:5696:1: note: in expansion of macro ‘XALAN_CPP_NAMESPACE_END’ > 5696 | XALAN_CPP_NAMESPACE_END > | ^~~~~~~~~~~~~~~~~~~~~~~ > 0xfbcc0f crash_signal > ../../src-trunk/gcc/toplev.c:326 > 0xb26b73 lookup_page_table_entry > ../../src-trunk/gcc/ggc-page.c:632 > 0xb26b73 ggc_set_mark(void const*) > ../../src-trunk/gcc/ggc-page.c:1531 > 0xd6a781 gt_ggc_mx_symtab_node(void*) > /export/gnu/import/git/gcc-test-spec-lto/bld/gcc/gtype-desc.c:1302 > 0xee51fd gt_ggc_ma_order > ./gt-passes.h:31 > 0xee51fd gt_ggc_ma_order > ./gt-passes.h:26 > 0xcf6995 ggc_mark_root_tab > ../../src-trunk/gcc/ggc-common.c:77 > 0xcf6b9c ggc_mark_roots() > ../../src-trunk/gcc/ggc-common.c:94 > 0xb274f5 ggc_collect() > ../../src-trunk/gcc/ggc-page.c:2201 > Please submit a full bug report, > with preprocessed source if appropriate. > Please include the complete backtrace with any bug report. > See <https://gcc.gnu.org/bugs/> for instructions. > [hjl@gnu-mic-1 build_base_lto.0000]$ > > -O2 -ffast-math is needed to trigger ICE. Hm, I can't reproduce that. How have you configured the compiler?
(In reply to Martin Liška from comment #10) > (In reply to H.J. Lu from comment #9) > > [hjl@gnu-mic-1 build_base_lto.0000]$ > > /export/gnu/import/git/gcc-test-spec-lto/usr/bin/g++ -S -DSPEC_CPU -DNDEBUG > > -DAPP_NO_THREADS -DXALAN_INMEM_MSG_LOADER -I. -Ixercesc -Ixercesc/dom > > -Ixercesc/dom/impl -Ixercesc/sax -Ixercesc/util/MsgLoaders/InMemory > > -Ixercesc/util/Transcoders/Iconv -Ixalanc/include -DPROJ_XMLPARSER > > -DPROJ_XMLUTIL -DPROJ_PARSERS -DPROJ_SAX4C -DPROJ_SAX2 -DPROJ_DOM > > -DPROJ_VALIDATORS -DXML_USE_NATIVE_TRANSCODER -DXML_USE_INMEM_MESSAGELOADER > > -O2 -DSPEC_CPU_LP64 -DSPEC_CPU_LINUX XPath.cpp -ffast-math > > In file included from ./XPathDefinitions.hpp:21, > > from XPath.hpp:22, > > from XPath.cpp:18: > > XPath.cpp: In member function ‘void > > xalanc_1_8::XPath::executeMore(xalanc_1_8::XalanNode*, > > xalanc_1_8::XPath::OpCodeMapPositionType, > > xalanc_1_8::XPathExecutionContext&, xalanc_1_8::FormatterListener&, > > xalanc_1_8::XPath::MemberFunctionPtr) const’: > > ./PlatformDefinitions.hpp:66:35: internal compiler error: Segmentation fault > > 66 | #define XALAN_CPP_NAMESPACE_END } > > | ^ > > XPath.cpp:5696:1: note: in expansion of macro ‘XALAN_CPP_NAMESPACE_END’ > > 5696 | XALAN_CPP_NAMESPACE_END > > | ^~~~~~~~~~~~~~~~~~~~~~~ > > 0xfbcc0f crash_signal > > ../../src-trunk/gcc/toplev.c:326 > > 0xb26b73 lookup_page_table_entry > > ../../src-trunk/gcc/ggc-page.c:632 > > 0xb26b73 ggc_set_mark(void const*) > > ../../src-trunk/gcc/ggc-page.c:1531 > > 0xd6a781 gt_ggc_mx_symtab_node(void*) > > /export/gnu/import/git/gcc-test-spec-lto/bld/gcc/gtype-desc.c:1302 > > 0xee51fd gt_ggc_ma_order > > ./gt-passes.h:31 > > 0xee51fd gt_ggc_ma_order > > ./gt-passes.h:26 > > 0xcf6995 ggc_mark_root_tab > > ../../src-trunk/gcc/ggc-common.c:77 > > 0xcf6b9c ggc_mark_roots() > > ../../src-trunk/gcc/ggc-common.c:94 > > 0xb274f5 ggc_collect() > > ../../src-trunk/gcc/ggc-page.c:2201 > > Please submit a full bug report, > > with preprocessed source if appropriate. > > Please include the complete backtrace with any bug report. > > See <https://gcc.gnu.org/bugs/> for instructions. > > [hjl@gnu-mic-1 build_base_lto.0000]$ > > > > -O2 -ffast-math is needed to trigger ICE. > > Hm, I can't reproduce that. How have you configured the compiler? I used: --enable-clocale=gnu --with-system-zlib --enable-shared --enable-cet --with-demangler-in-ld --with-fpmath=sse --enable-languages=c,c++,fortran,lto
I opened PR 91404.