summaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-13 20:30:10 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2010-10-13 20:30:10 +0000
commit252a0b874fc8b9ee248159fa6e951b07410027e3 (patch)
tree42d93daff79578d66b6660c2821be75d45c938a4 /gcc/gimple-fold.c
parent382597e4e1587e7de04f81ba9903811a8a93d640 (diff)
downloadgcc-252a0b874fc8b9ee248159fa6e951b07410027e3.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165435 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index ce232e609e1..697e3643528 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