calls.c (expand_call): When modes of target and valreg match, force sibcall failure...
authorOlivier Hainque <hainque@act-europe.fr>
Tue, 29 Apr 2003 21:47:42 +0000 (23:47 +0200)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 29 Apr 2003 21:47:42 +0000 (17:47 -0400)
* calls.c (expand_call): When modes of target and valreg match, force
sibcall failure when target is a MEM.

From-SVN: r66260

gcc/ChangeLog
gcc/calls.c

index 2b65a5c744464273565c4cc8bfef16af8856579a..589009a8285b55bbb6072b0c36ced3e5e1009a80 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-29  Olivier Hainque <hainque@act-europe.fr>
+
+       * calls.c (expand_call): When modes of target and valreg match, force
+       sibcall failure when target is a MEM.
+
 2003-04-29  Geoffrey Keating  <geoffk@apple.com>
 
        * doc/invoke.texi (Overall Options): Mention -x objective-c-header.
index bd889e1ae71537f4b07377202598ac21c506f70c..135f949028c4d9d0d27ce2c74768c5b7e99aac3f 100644 (file)
@@ -3279,6 +3279,12 @@ expand_call (exp, target, ignore)
             If they refer to the same register, this move will be a no-op,
             except when function inlining is being done.  */
          emit_move_insn (target, valreg);
+
+         /* If we are setting a MEM, this code must be executed.  Since it is
+            emitted after the call insn, sibcall optimization cannot be
+            performed in that case.  */
+         if (GET_CODE (target) == MEM)
+           sibcall_failure = 1;
        }
       else if (TYPE_MODE (TREE_TYPE (exp)) == BLKmode)
        {