From 28edebac58063d9c67e10121dd9d56d3a7776dd2 Mon Sep 17 00:00:00 2001 From: Richard Kenner Date: Tue, 19 Jan 1993 17:54:22 -0500 Subject: [PATCH] (output_epilog): Only restore the cr's that we actually used; previously, we saved and restored all of them. From-SVN: r3282 --- gcc/config/rs6000/rs6000.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 2bfaa3dd8a6..b9a233299fe 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. */ -- 2.30.2