Bug 23162 - [3.4 only] internal compiler error: in c_expand_expr, at c-common.c:4138
Summary: [3.4 only] internal compiler error: in c_expand_expr, at c-common.c:4138
Status: RESOLVED WONTFIX
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 3.4.4
: P2 normal
Target Milestone: 3.4.6
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2005-07-31 14:22 UTC by mki
Modified: 2006-03-01 03:59 UTC (History)
3 users (show)

See Also:
Host:
Target: hppa2.0w-hp-hpux11.11
Build:
Known to work: 4.0.0
Known to fail: 3.4.5
Last reconfirmed: 2005-11-02 00:03:29


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mki 2005-07-31 14:22:15 UTC
Compiling a 1.5 Mb ii gave an ICE. It has been reduced as much as I could,
giving the following case:

-bash-3.00$ cat d.cpp
namespace std
{
  template<typename _Tp1>
    struct auto_ptr_ref { };

  template<typename _Tp>
    class auto_ptr
    {
    public:
      auto_ptr(auto_ptr& __a) {}

      auto_ptr(auto_ptr_ref<_Tp> __ref) {}

      auto_ptr& operator=(auto_ptr_ref<_Tp> __ref) {}

      template<typename _Tp1>
        operator auto_ptr_ref<_Tp1>() {}

      template<typename _Tp1>
        operator auto_ptr<_Tp1>() {}
  };
}

class C
{
  virtual std::auto_ptr<int> foo() const;
};

class D : virtual C
{
  ~D();
  virtual std::auto_ptr<int> foo() const { }
};

D::~D() {}
-bash-3.00$ /usr/local/gcc-3.4.4/bin/g++ -v --save-temp d.cpp
Reading specs from /usr/local/gcc-3.4.4/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.4/specs
Configured with: /data/develop/src/gcc-3.4.4/configure --enable-languages=c,c++
--with-gnu-as --without-gnu-ld --with-as=/usr/local/binutils-2.16/bin/as
--prefix=/usr/local/gcc-3.4.4
Thread model: single
gcc version 3.4.4
 /usr/local/gcc-3.4.4/libexec/gcc/hppa2.0w-hp-hpux11.11/3.4.4/cc1plus -E -quiet
-v d.cpp -o d.ii
ignoring nonexistent directory "/usr/local/gcc-3.4.4/hppa2.0w-hp-hpux11.11/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/gcc-3.4.4/include/c++/3.4.4
 /usr/local/gcc-3.4.4/include/c++/3.4.4/hppa2.0w-hp-hpux11.11
 /usr/local/gcc-3.4.4/include/c++/3.4.4/backward
 /usr/local/include
 /usr/local/gcc-3.4.4/include
 /usr/local/gcc-3.4.4/lib/gcc/hppa2.0w-hp-hpux11.11/3.4.4/include
 /usr/include
End of search list.
 /usr/local/gcc-3.4.4/libexec/gcc/hppa2.0w-hp-hpux11.11/3.4.4/cc1plus
-fpreprocessed d.ii -quiet -dumpbase d.cpp -auxbase d -version -o d.s
GNU C++ version 3.4.4 (hppa2.0w-hp-hpux11.11)
        compiled by GNU C version 3.4.4.
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=130816
d.cpp: In member function `std::auto_ptr<int> D::_ZTv0_n12_NK1D3fooEv() const':
d.cpp:30: internal compiler error: in c_expand_expr, at c-common.c:4138
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
-bash-3.00$

Same ICE with 3.4.3. 3.3.6 as well as 4.0.1 complains (probably correctly) that
the reduced code isn't valid.

Upgrading to 4.0.1 isn't possible at the moment bco other ICEs, so I hope to
find a 3.x.x solution...
Comment 1 Andrew Pinski 2005-07-31 17:32:30 UTC
Confirmed, this is really fixed on 4.0.0 and above.

I don't know if this is going to be fixed on the 3.4 branch as it was fixed for 4.0 by the merge of the 
tree-ssa which is too big to merge into the 3.4 branch.
Comment 2 Andrew Pinski 2005-07-31 17:35:02 UTC
We have an aggr_init_expr here.
Comment 3 mki 2005-08-01 13:45:28 UTC
Forgot to mention:

The ICE seems to be platform specific. My testcase works on linux with 3.3.4,
3.4.3 and 4.0.1. 

It thus (to me) seems slightly related to PR c++/21123... (But
--disable-checking makes no difference.)
Comment 4 John David Anglin 2005-08-02 01:51:09 UTC
The testcase fails on all 3.4 releases on hppa-unknown-linux-gnu (i.e.,
the failure isn't specific to hpux).

--disable-checking has no effect in this case as the ICE is generated
by calling abort.
Comment 5 Gabriel Dos Reis 2005-11-21 02:34:49 UTC
Postponed until GCC 3.4.6
Comment 6 Gabriel Dos Reis 2006-03-01 03:59:01 UTC
Unlikely to be fixed in 3.4.6