Bug 31411 - [4.1/4.2 Regression] ICE in gimplify_expr with throw/special copy constructor with initializer with a deconstructor
Summary: [4.1/4.2 Regression] ICE in gimplify_expr with throw/special copy constructor...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.2
: P1 normal
Target Milestone: 4.1.3
Assignee: Jason Merrill
URL:
Keywords: ice-on-valid-code, monitored
Depends on:
Blocks:
 
Reported: 2007-03-31 17:22 UTC by gkajmowi
Modified: 2007-09-11 15:35 UTC (History)
4 users (show)

See Also:
Host:
Target:
Build:
Known to work: 3.4.6 4.3.0
Known to fail: 4.0.0 4.0.4 4.1.2 4.2.0
Last reconfirmed: 2007-09-04 12:39:39


Attachments
This is sample code which causes ICE under GCC (48.30 KB, application/x-gzip)
2007-03-31 17:23 UTC, gkajmowi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gkajmowi 2007-03-31 17:22:20 UTC
g++ test1.ii
test1.cpp: In function ‘int main()’:
test1.cpp:21: internal compiler error: in gimplify_expr, at gimplify.c:4519
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
Preprocessed source stored into /tmp/ccICvwkX.out file, please attach this to your bugreport.
Comment 1 gkajmowi 2007-03-31 17:23:30 UTC
Created attachment 13308 [details]
This is sample code which causes ICE under GCC
Comment 2 Martin Michlmayr 2007-03-31 17:59:17 UTC
Confirmed.
Comment 3 Drea Pinski 2007-03-31 18:04:31 UTC
Reducing...
Comment 4 Martin Michlmayr 2007-03-31 18:09:14 UTC
Testcase:


namespace std
{
  template < class T > class allocator
  {
  public:typedef T value_type;
    typedef long unsigned int size_type;
     ~allocator ()
    {
    }
  };
  template < class charT > struct char_traits
  {
  };
  template < class T, class Allocator > class vector
  {
  };
  template < class Ch, class Tr = char_traits < Ch >, class A =
    allocator < Ch > >class basic_string;
  typedef basic_string < char >string;
template < class Ch, class Tr, class A > class basic_string:public
  std::vector < Ch, A >
  {
  public:typedef Tr traits_type;
    typedef typename A::size_type size_type;
    static const size_type npos = (size_type) - 1;
    basic_string (const basic_string & str, size_type pos = 0, size_type n =
                  npos, const A & al = A ());
  };
}
using namespace std;
main ()
{
  try
  {
  }
  catch (string smess)
  {
  }
}
Comment 5 Martin Michlmayr 2007-03-31 18:09:54 UTC
This also happens with 4.3.  I cannot check 4.0.
Comment 6 Drea Pinski 2007-03-31 18:21:46 UTC
Really reduced testcase:
struct allocator{
	~allocator() throw();
};
struct string
{
	string(const string& str, const allocator& al = allocator());
};
int main() {
        try {}
	catch (string smess) {}
}
Comment 7 Janis Johnson 2007-04-23 17:27:41 UTC
A regression hunt identified the tree-ssa merge to mainline.
Comment 8 Jason Merrill 2007-09-04 18:37:48 UTC
Subject: Bug 31411

Author: jason
Date: Tue Sep  4 18:37:33 2007
New Revision: 128100

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128100
Log:
        PR c++/31411
        * except.c (initialize_handler_parm): Put a CLEANUP_POINT_EXPR inside
        the MUST_NOT_THROW_EXPR.

Added:
    trunk/gcc/testsuite/g++.dg/eh/catch5.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/except.c

Comment 9 Jason Merrill 2007-09-11 15:35:43 UTC
Fixed for 4.2.2.