diff mbox

Fix class type lookup from OBJ_TYPE_REF

Message ID 20130817181503.GA23244@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka Aug. 17, 2013, 6:15 p.m. UTC
Hi,
this is the patch I comitted after testing.
My apologizes for the breakage.

Honza

Comments

Gerald Pfeifer Aug. 17, 2013, 9:02 p.m. UTC | #1
On Sat, 17 Aug 2013, Jan Hubicka wrote:
> this is the patch I comitted after testing.
> My apologizes for the breakage.
> 
> +2013-08-16  Jan Hubicka  <jh@suse.cz>
> +
> +	PR middle-end/58179
> +	* tree.c (obj_type_ref_class): Do not ICE on non-method calls.

This fixes my bootstraps on {amd64,i386}-unknown-freebsd*, too.  Thanks.

Gerald
diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 201816)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@ 
+2013-08-16  Jan Hubicka  <jh@suse.cz>
+
+	PR middle-end/58179
+	* tree.c (obj_type_ref_class): Do not ICE on non-method calls.
+
 2013-08-16  David Edelsohn  <dje.gcc@gmail.com>
 
 	* config/rs6000/rs6000.md (rs6000_get_timebase_ppc32): Add length
Index: tree.c
===================================================================
--- tree.c	(revision 201814)
+++ tree.c	(working copy)
@@ -11873,7 +11873,11 @@  obj_type_ref_class (tree ref)
   ref = TREE_TYPE (ref);
   gcc_checking_assert (TREE_CODE (ref) == POINTER_TYPE);
   ref = TREE_TYPE (ref);
-  gcc_checking_assert (TREE_CODE (ref) == METHOD_TYPE);
+  /* We look for type THIS points to.  ObjC also builds
+     OBJ_TYPE_REF with non-method calls, Their first parameter
+     ID however also corresponds to class type. */
+  gcc_checking_assert (TREE_CODE (ref) == METHOD_TYPE
+		       || TREE_CODE (ref) == FUNCTION_TYPE);
   ref = TREE_VALUE (TYPE_ARG_TYPES (ref));
   gcc_checking_assert (TREE_CODE (ref) == POINTER_TYPE);
   return TREE_TYPE (ref);