summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-24 22:52:42 +0000
committerpinskia <pinskia@138bc75d-0d04-0410-961f-82ee72b054a4>2004-06-24 22:52:42 +0000
commit29bcfd15d0d2c19dfdcb8bcc83f4087c47383f55 (patch)
tree15593a712bb36cc7c27a0e4850edc13d51587aab /gcc
parent15a9f039807b600e20657f00edd72231c467635c (diff)
downloadgcc-29bcfd15d0d2c19dfdcb8bcc83f4087c47383f55.tar.gz
2004-06-24 Andrew Pinski <apinski@apple.com>
* objc-act.c (build_objc_method_call): Save the lookup_object so we do not call it twice. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@83618 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/objc/objc-act.c8
2 files changed, 10 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index f4eaef744c1..32c07125d0a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-24 Andrew Pinski <apinski@apple.com>
+
+ * objc-act.c (build_objc_method_call): Save the lookup_object
+ so we do not call it twice.
+
2004-06-24 Richard Henderson <rth@redhat.com>
* tree-ssa-dom.c (real_avail_expr_hash): New.
diff --git a/gcc/objc/objc-act.c b/gcc/objc/objc-act.c
index 9664273529d..39e6f765ae7 100644
--- a/gcc/objc/objc-act.c
+++ b/gcc/objc/objc-act.c
@@ -5869,6 +5869,9 @@ build_objc_method_call (int super_flag, tree method_prototype,
tree method, t;
lookup_object = build_c_cast (rcv_p, lookup_object);
+
+ /* Use SAVE_EXPR to avoid evaluating the receiver twice. */
+ lookup_object = save_expr (lookup_object);
if (flag_next_runtime)
{
@@ -5895,9 +5898,8 @@ build_objc_method_call (int super_flag, tree method_prototype,
tree object;
/* First, call the lookup function to get a pointer to the method,
- then cast the pointer, then call it with the method arguments.
- Use SAVE_EXPR to avoid evaluating the receiver twice. */
- lookup_object = save_expr (lookup_object);
+ then cast the pointer, then call it with the method arguments. */
+
object = (super_flag ? self_decl : lookup_object);
t = tree_cons (NULL_TREE, selector, NULL_TREE);