s390.c (s390_fixup_clobbered_return_reg): Do nothing if __builtin_return_address...
authorUlrich Weigand <uweigand@de.ibm.com>
Tue, 1 Apr 2003 17:32:33 +0000 (17:32 +0000)
committerUlrich Weigand <uweigand@gcc.gnu.org>
Tue, 1 Apr 2003 17:32:33 +0000 (17:32 +0000)
* config/s390/s390.c (s390_fixup_clobbered_return_reg):
Do nothing if __builtin_return_address was not used.

From-SVN: r65133

gcc/ChangeLog
gcc/config/s390/s390.c

index 03b97444fde5d5d33c1fdec225e73e8c96203d8c..a53b56b7b6d11f64bb753f7b0201ccb353772fc0 100644 (file)
@@ -1,3 +1,8 @@
+2003-04-01  Ulrich Weigand  <uweigand@de.ibm.com>
+
+       * config/s390/s390.c (s390_fixup_clobbered_return_reg):
+       Do nothing if __builtin_return_address was not used.
+
 Tue Apr  1 18:18:23 CEST 2003  Jan Hubicka  <jh@suse.cz>
 
        * i386.md (test patterns):  Allow memory operand in operand1.
index b1e7c5b1897f3653e696cbdbcb56d116e39e87b1..3a6c213e2b4bc8d1646972c519be3571f65e98e3 100644 (file)
@@ -4905,6 +4905,12 @@ s390_fixup_clobbered_return_reg (return_reg)
   bool replacement_done = 0;
   rtx insn;
 
+  /* If we never called __builtin_return_address, register 14
+     might have been used as temp during the prolog; we do
+     not want to touch those uses.  */
+  if (!has_hard_reg_initial_val (Pmode, REGNO (return_reg)))
+    return false;
+
   for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
     {
       rtx reg, off, new_insn;