diff options
author | Richard Guenther <rguenther@suse.de> | 2010-10-13 20:30:10 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-10-13 20:30:10 +0000 |
commit | 0d8485e009278fccd6f6faffc81726bfd6d83716 (patch) | |
tree | 42d93daff79578d66b6660c2821be75d45c938a4 /gcc/gimple-fold.c | |
parent | bde8a146a602d86483dff9a5b0a9f34419ab3d32 (diff) | |
download | gcc-0d8485e009278fccd6f6faffc81726bfd6d83716.zip gcc-0d8485e009278fccd6f6faffc81726bfd6d83716.tar.gz gcc-0d8485e009278fccd6f6faffc81726bfd6d83716.tar.bz2 |
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
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r-- | gcc/gimple-fold.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c index ce232e60..697e364 100644 --- a/gcc/gimple-fold.c +++ b/gcc/gimple-fold.c @@ -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 |