Bug 38355 - ICE with -fipa-struct-reorg
Summary: ICE with -fipa-struct-reorg
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.3.3
: P3 normal
Target Milestone: 4.7.0
Assignee: Not yet assigned to anyone
Keywords: ice-on-valid-code, monitored
Depends on:
Reported: 2008-12-01 22:50 UTC by Debian GCC Maintainers
Modified: 2012-01-19 04:56 UTC (History)
12 users (show)

See Also:
Known to work:
Known to fail: 4.3.3, 4.4.0
Last reconfirmed: 2009-11-14 21:21:13

preprocessed source (2.45 KB, text/x-c++src)
2008-12-01 22:50 UTC, Debian GCC Maintainers

Note You need to log in before you can comment on or make changes to this bug.
Description Debian GCC Maintainers 2008-12-01 22:50:24 UTC
[forwarded from http://bugs.debian.org/PR498708]

seen with 4.3 branch and trunk 20081130, building without -fipa-struct-reorg works.

$ g++ -O3 -fwhole-program -fipa-struct-reorg xx.cc
xx.cc:289: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.

$ g++ -O3 -fwhole-program -fipa-pta xx.cc
/usr/include/c++/4.3/bits/vector.tcc: In member function 'void std::vector<_Tp, _Alloc>::_M_insert_aux(__gnu_cxx::__normal_iterator<typename std::_Vector_base<_Tp, _Alloc>::_Tp_alloc_type::pointer, std::vector<_Tp, _Alloc> >, const _Tp&) [with _Tp = int, _Alloc = std::allocator<int>]':
/usr/include/c++/4.3/bits/vector.tcc:283: internal compiler error: in initialize_flags_in_bb, at tree-into-ssa.c:437
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-4.3/README.Bugs> for instructions.
Comment 1 Debian GCC Maintainers 2008-12-01 22:50:45 UTC
Created attachment 16804 [details]
preprocessed source
Comment 2 Andrew Pinski 2008-12-01 22:54:05 UTC
-fipa-pta does nothing ...
Comment 3 Andrew Pinski 2008-12-01 22:55:50 UTC

*** This bug has been marked as a duplicate of 32305 ***
Comment 4 Richard Biener 2008-12-02 11:05:11 UTC
Re-opening as the -fipa-struct-reorg case.
Comment 5 Volker Reichelt 2009-11-14 21:21:12 UTC
Reduced testcase (crashes with "-O2 -fwhole-program -fipa-struct-reorg"):

template<int> struct A
  char c;
  void foo(int);
  void bar(int i) { foo(i+1); }

template<int> struct B : virtual A<0> {};

template<int T> inline void baz(B<T>& b, int i)
  if (i) b.bar(0);

extern template class A<0>;
extern template void baz(B<0>&, int);

int main()
  B<0> b;
  baz(b, 0);
  return 0;

GCC 4.3.x and 4.4.x segfault, while trunk produced the following ICE:

bug.cc:23:1: internal compiler error: in build_data_structure, at ipa-struct-reorg.c:3387
Please submit a full bug report, [etc.]
Comment 6 Andrew Pinski 2012-01-19 04:56:06 UTC
The pass was removed by:
2011-03-23  Richard Guenther  <rguenther@suse.de>

        * Makefile.in (IPA_TYPE_ESCAPE_H): Remove.
        (OBJS-archive): Remove ipa-struct-reorg.o and ipa-type-escape.o.
        (tree-ssa-alias.o): Do not depend on IPA_TYPE_ESCAPE_H.
        (alias.o): Likewise.
        (ipa-type-escape.o): Remove.
        (ipa-struct-reorg.o): Likewise.
        (GTFILES): Remove ipa-struct-reorg.c.
        * alias.c: Do not include ipa-type-escape.h.
        * tree-ssa-alias.c: Likewise.
        * common.opt (fipa-struct-reorg): Preserve for backward compatibility.
        * opts.c (finish_options): Do not reset flag_ipa_struct_reorg.
        * passes.c (init_optimization_passes): Remove ipa-struct-reorg
        and ipa-type-escape passes.
        * tree-pass.h (pass_ipa_type_escape): Remove.
        (pass_ipa_struct_reorg): Likewise.

So closing as won't fix.