[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-08 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

H.J. Lu  changed:

   What|Removed |Added

 Status|WAITING |RESOLVED
 Resolution|--- |FIXED

--- Comment #12 from H.J. Lu  ---
I opened PR 91404.

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-08 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

--- Comment #11 from H.J. Lu  ---
(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.]$
> > /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  for instructions.
> > [hjl@gnu-mic-1 build_base_lto.]$ 
> > 
> > -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

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-08 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

--- Comment #10 from Martin Liška  ---
(In reply to H.J. Lu from comment #9)
> [hjl@gnu-mic-1 build_base_lto.]$
> /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  for instructions.
> [hjl@gnu-mic-1 build_base_lto.]$ 
> 
> -O2 -ffast-math is needed to trigger ICE.

Hm, I can't reproduce that. How have you configured the compiler?

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-07 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

--- Comment #9 from H.J. Lu  ---
[hjl@gnu-mic-1 build_base_lto.]$
/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  for instructions.
[hjl@gnu-mic-1 build_base_lto.]$ 

-O2 -ffast-math is needed to trigger ICE.

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-07 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

Martin Liška  changed:

   What|Removed |Added

 Status|REOPENED|WAITING

--- Comment #8 from Martin Liška  ---
Can you please provide both compiler options used and a test-case?

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-06 Thread hjl.tools at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

H.J. Lu  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 Resolution|FIXED   |---

--- Comment #7 from H.J. Lu  ---
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  for instructions.

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

Martin Liška  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #6 from Martin Liška  ---
Should be fixed now.

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-05 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

--- Comment #5 from Martin Liška  ---
Author: marxin
Date: Mon Aug  5 12:53:01 2019
New Revision: 274115

URL: https://gcc.gnu.org/viewcvs?rev=274115=gcc=rev
Log:
Handle new operators with no arguments in DCE.

2019-08-05  Martin Liska  

PR c++/91334
* tree-ssa-dce.c (propagate_necessity): Handle new operators
with not arguments.
(eliminate_unnecessary_stmts): Likewise.
2019-08-05  Martin Liska  

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

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-04 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

Martin Liška  changed:

   What|Removed |Added

 CC||zeccav at gmail dot com

--- Comment #4 from Martin Liška  ---
*** Bug 91350 has been marked as a duplicate of this bug. ***

[Bug c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-04 Thread dcb314 at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

David Binderman  changed:

   What|Removed |Added

 CC||dcb314 at hotmail dot com

--- Comment #3 from David Binderman  ---
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 c++/91334] [10 Regression] ICE in propagate_necessity at gcc/tree-ssa-dce.c:813 since r273791

2019-08-03 Thread marxin at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91334

Martin Liška  changed:

   What|Removed |Added

   Priority|P3  |P1
  Known to work||9.1.0
   Target Milestone|--- |10.0
Summary|[10 Regression] internal|[10 Regression] ICE in
   |compiler error: |propagate_necessity at
   |Segmentation fault  |gcc/tree-ssa-dce.c:813
   ||since r273791
  Known to fail||10.0

--- Comment #2 from Martin Liška  ---
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.