(output_epilog): Only restore the cr's that we actually used;
authorRichard Kenner <kenner@gcc.gnu.org>
Tue, 19 Jan 1993 22:54:22 +0000 (17:54 -0500)
committerRichard Kenner <kenner@gcc.gnu.org>
Tue, 19 Jan 1993 22:54:22 +0000 (17:54 -0500)
previously, we saved and restored all of them.

From-SVN: r3282

gcc/config/rs6000/rs6000.c

index 2bfaa3d..b9a2332 100644 (file)
@@ -1385,9 +1385,13 @@ output_epilog (file, size)
       else if (first_fp_reg == 63)
        fprintf (file, "\tlfd 31,-8(1)\n");
 
-      /* If we saved cr, restore it here.  Just set cr2, cr3, and cr4.  */
+      /* If we saved cr, restore it here.  Just those of cr2, cr3, and cr4
+        that were used.  */
       if (must_save_cr ())
-       fprintf (file, "\tmtcrf 0x38,12\n");
+       fprintf (file, "\tmtcrf %d,12\n",
+                (regs_ever_live[70] != 0) * 0x20
+                + (regs_ever_live[71] != 0) * 0x10
+                + (regs_ever_live[72] != 0) * 0x8);
 
       /* If we have to restore more than two FP registers, branch to the
         restore function.  It will return to our caller.  */