Bug 42038 - [4.3/4.4 Regression] ICE: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p
Summary: [4.3/4.4 Regression] ICE: tree check: expected class 'type', have 'exceptiona...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P5 normal
Target Milestone: 4.5.0
Assignee: Paolo Carlini
URL:
Keywords: error-recovery, ice-on-invalid-code, monitored
Depends on:
Blocks:
 
Reported: 2009-11-14 00:03 UTC by Dmitry Gorbachev
Modified: 2010-01-21 12:18 UTC (History)
4 users (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2009-11-14 01:58:47


Attachments
The bug.cc file (74 bytes, text/plain)
2009-11-14 01:31 UTC, Dmitry Gorbachev
Details
Draft patch (673 bytes, patch)
2009-11-23 23:19 UTC, Paolo Carlini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Dmitry Gorbachev 2009-11-14 00:03:19 UTC
`g++ bug.cc' causes this error:

bug.cc: In function 'void f()':
bug.cc:5:20: error: '__cxa_begin_catch' cannot be used as a function
bug.cc:5:20: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in useless_type_conversion_p, at tree-ssa.c:1221
Comment 1 Paolo Carlini 2009-11-14 00:15:20 UTC
And bug.cc is...
Comment 2 Dmitry Gorbachev 2009-11-14 01:31:36 UTC
Created attachment 19015 [details]
The bug.cc file

Sorry, forgot it. :)
Comment 3 Paolo Carlini 2009-11-14 01:58:46 UTC
Funny, and I agree the compiler should behave more gracefully, but this code is invalid per 17.4.3.1.2: names containing a double underscore are reserved.
Comment 4 Paolo Carlini 2009-11-23 23:18:34 UTC
Jason, as far as I know, we never compiled this, the ICE is new. If we only want to avoid the ICE, I'm attaching a patchlet to except.c which works fine, otherwise, please let me know...
Comment 5 Paolo Carlini 2009-11-23 23:19:39 UTC
Created attachment 19105 [details]
Draft patch
Comment 6 Volker Reichelt 2009-11-29 15:56:02 UTC
The ICE happens since GCC 4.2.0.
Comment 7 Jason Merrill 2010-01-20 22:11:27 UTC
The patch is OK.
Comment 8 paolo@gcc.gnu.org 2010-01-20 23:12:46 UTC
Subject: Bug 42038

Author: paolo
Date: Wed Jan 20 23:12:25 2010
New Revision: 156094

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=156094
Log:
/cp
2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42038
	* except.c (expand_start_catch_block): Deal correctly with
	do_begin_catch returning error_mark_node.

/testsuite
2010-01-20  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/42038
	* g++.dg/parse/crash55.C: New.

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

Comment 9 Paolo Carlini 2010-01-20 23:15:31 UTC
Fixed for 4.5.0. Being just an ice-on-invalid will not be fixed in 4_3 / 4_4.