mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-03-19 08:20:32 +08:00
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
This commit is contained in:
parent
bde8a146a6
commit
0d8485e009
@ -1,3 +1,9 @@
|
||||
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
|
||||
|
@ -1,3 +1,8 @@
|
||||
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.
|
||||
|
28
gcc/testsuite/objc.dg/pr45878.m
Normal file
28
gcc/testsuite/objc.dg/pr45878.m
Normal file
@ -0,0 +1,28 @@
|
||||
/* { 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])
|
||||
{
|
||||
;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user