Commit 0d8485e0 by Richard Guenther Committed by Richard Biener

re PR objc/45878 (Can't compile even a trivial ObjC program with -fexceptions -O2)

2010-10-13  Richard Guenther  <rguenther@suse.de>

	PR objc/45878
	* gimple-fold.c (gimple_fold_obj_type_ref): Leave OBJ_TYPE_REFs
	alone if there are no virtual methods.

	* objc.dg/pr45878.m: New testcase.

From-SVN: r165435
parent bde8a146
2010-10-13 Richard Guenther <rguenther@suse.de>
PR objc/45878
* gimple-fold.c (gimple_fold_obj_type_ref): Leave OBJ_TYPE_REFs
alone if there are no virtual methods.
2010-10-13 Richard Henderson <rth@redhat.com>
* expr.c (build_personality_function): Take parameter LANG instead
......@@ -1524,9 +1524,9 @@ gimple_fold_obj_type_ref (tree ref, tree known_type)
if (binfo)
{
HOST_WIDE_INT token = tree_low_cst (OBJ_TYPE_REF_TOKEN (ref), 1);
/* If there is no virtual methods fold this to an indirect call. */
/* If there is no virtual methods leave the OBJ_TYPE_REF alone. */
if (!BINFO_VIRTUALS (binfo))
return OBJ_TYPE_REF_EXPR (ref);
return NULL_TREE;
return gimple_fold_obj_type_ref_known_binfo (token, binfo);
}
else
......
2010-10-13 Richard Guenther <rguenther@suse.de>
PR objc/45878
* objc.dg/pr45878.m: New testcase.
2010-10-13 Kai Tietz <kai.tietz@onevision.com>
* gcc.dg/format/dfp-scanf-1.c: Disable for *-*-mingw* targets.
......
/* { dg-do compile } */
/* { dg-options "-O2 -fexceptions" } */
typedef struct objc_object { Class class_pointer; } *id;
typedef unsigned char BOOL;
@interface Object
{
Class isa;
}
- (BOOL)isEqual:anObject;
@end
@interface NXConstantString: Object
{
char *c_string;
unsigned int len;
}
@end
void function (void)
{
if ([@"strings" isEqual: (id)0])
{
;
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment