Bug 23716 - obj-c++.dg/comp-types-10.mm ICE with the GNU runtime
Summary: obj-c++.dg/comp-types-10.mm ICE with the GNU runtime
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: objc++ (show other bugs)
Version: 4.1.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: ice-on-valid-code
: 27246 28020 (view as bug list)
Depends on:
Blocks:
 
Reported: 2005-09-03 12:41 UTC by Andrew Pinski
Modified: 2010-06-07 10:45 UTC (History)
7 users (show)

See Also:
Host:
Target: *-*-*
Build:
Known to work:
Known to fail: 4.1.3 4.2.4 4.3.0
Last reconfirmed: 2008-02-08 01:22:15


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Pinski 2005-09-03 12:41:41 UTC
FAIL: obj-c++.dg/comp-types-10.mm (test for excess errors)
Excess errors:
/home/pinskia/src/onetest/gcc/gcc/testsuite/obj-c++.dg/comp-types-10.mm:19: internal compiler 
error: tree check: expected class 'type', have 'exceptional' (error_mark) in setup_one_parameter, at tree-
inline.c:1116

The reason is:

__objc_gnu_init (D.2186)

Is that we have a function which takes a paramater which is not needed but have a type of 
error_mark_node for some reason.
Comment 1 Andrew Pinski 2005-09-03 12:42:02 UTC
Confirmed, based on
http://gcc.gnu.org/ml/gcc-testresults/2005-09/msg00118.html

.
Comment 2 Christian Joensson 2005-10-09 21:00:41 UTC
Also here... http://gcc.gnu.org/ml/gcc/2005-10/msg00198.html
Comment 3 Janis Johnson 2006-04-20 23:31:53 UTC
This test and obj-c++.dg/try-catch-9.mm get the same ICE on powerpc-linux on trunk as of 2006-04-20, and have failed since I started including obj-c++ on 2005-11-02.
Comment 4 Andrew Pinski 2006-04-21 23:32:45 UTC
*** Bug 27246 has been marked as a duplicate of this bug. ***
Comment 5 Andrew Pinski 2006-06-14 04:19:17 UTC
*** Bug 28020 has been marked as a duplicate of this bug. ***
Comment 6 John David Anglin 2006-10-16 22:32:08 UTC
Also fails on hppa2.0w-hp-hpux11.11.
Comment 7 Martin Michlmayr 2007-03-04 01:42:14 UTC
Fails here with 4.3 with:

internal compiler error: tree check: expected class 'expression', have 'exceptional' (error_mark) in build_min_nt, at cp/tree.c:1489
Comment 8 Kaveh Ghazi 2008-02-08 01:22:15 UTC
This failure occurs on x86_64-unknown-linux-gnu on 4.1, 4.2 and trunk:

http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg00469.html
http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg00468.html
http://gcc.gnu.org/ml/gcc-testresults/2008-02/msg00466.html

The tree checking failure says:

comp-types-10.mm:19: internal compiler error: tree check: expected class 'type', have 'exceptional' (error_mark) in setup_one_parameter, at tree-inline.c:1535
Comment 9 IainS 2010-03-26 20:09:43 UTC
also fails on *-*-darwin* with -fgnu-runtime.
Comment 10 IainS 2010-03-26 21:44:56 UTC
(In reply to comment #9)
> also fails on *-*-darwin* with -fgnu-runtime.

note the fail does not occur (at least on ppc darwin) with -O0

Comment 11 IainS 2010-03-27 11:59:56 UTC
It seems that objc_start_function is expecting a TREE in the objcpp case - so the error marked node is indeed unexpected.

I've tried this on i686-darwin and i32-linux - but there are obviously a lot of affected platforms out there - would some of you like to try this?


Index: gcc/objc/objc-act.c
===================================================================
--- gcc/objc/objc-act.c	(revision 157761)
+++ gcc/objc/objc-act.c	(working copy)
@@ -2391,11 +2398,17 @@
 
   objc_push_parm (build_decl (input_location,
 			      PARM_DECL, NULL_TREE, void_type_node));
+#ifdef OBJCPLUS
   objc_start_function (get_identifier (TAG_GNUINIT),
 		       build_function_type (void_type_node,
 					    OBJC_VOID_AT_END),
+		       NULL_TREE, NULL_TREE);
+#else
+  objc_start_function (get_identifier (TAG_GNUINIT),
+		       build_function_type (void_type_node,
+					    OBJC_VOID_AT_END),
 		       NULL_TREE, objc_get_parm_info (0));
-
+#endif
   body = c_begin_compound_stmt (true);
   add_stmt (build_function_call
 	    (input_location,
Comment 12 mrs@gcc.gnu.org 2010-04-02 23:57:18 UTC
Ok.  Ok for gcc-4.5.
Comment 13 Iain Sandoe 2010-04-07 16:20:27 UTC
Subject: Bug 23716

Author: iains
Date: Wed Apr  7 16:20:08 2010
New Revision: 158076

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=158076
Log:
fix PR23716

2010-04-07  Iain Sandoe <iains@gcc.gnu.org>

	PR objc++/23716
	* objc-act.c (build_module_initializer_routine): Make the argument
	to objc_start_function NULL_TREE when compiling ObjC++.

2010-04-07  Iain Sandoe <iains@gcc.gnu.org>

	PR objc++/23716
	* obj-c++.dg/comp-types-10.mm: Remove XFAIL.


Modified:
    trunk/gcc/objc/ChangeLog
    trunk/gcc/objc/objc-act.c
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/obj-c++.dg/comp-types-10.mm

Comment 14 Iain Sandoe 2010-06-07 10:45:29 UTC
closing after back-porting to 4.5;
 if anyone feels passionately about a merge to 4.4 ... they can re-open.