PR middle-end/58179
* tree.c (obj_type_ref_class): Do not ICE on non-method calls.
From-SVN: r201817
+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
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);