aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Kenner <kenner@gcc.gnu.org>1993-01-19 17:54:22 -0500
committerRichard Kenner <kenner@gcc.gnu.org>1993-01-19 17:54:22 -0500
commit28edebac58063d9c67e10121dd9d56d3a7776dd2 (patch)
tree129ca373e6d060bcc93fd9a125d5b7a5bda3de22 /gcc
parentf898f03121cf231a8b458cd097cdd6df85110c1e (diff)
downloadgcc-28edebac58063d9c67e10121dd9d56d3a7776dd2.zip
gcc-28edebac58063d9c67e10121dd9d56d3a7776dd2.tar.gz
gcc-28edebac58063d9c67e10121dd9d56d3a7776dd2.tar.bz2
(output_epilog): Only restore the cr's that we actually used;
previously, we saved and restored all of them. From-SVN: r3282
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/rs6000/rs6000.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c
index 2bfaa3dd..b9a2332 100644
--- a/gcc/config/rs6000/rs6000.c
+++ b/gcc/config/rs6000/rs6000.c
@@ -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. */