diff mbox

[RS6000] Fix -m32 -Os lossage

Message ID 20150212221030.GP4274@bubble.grove.modra.org
State New
Headers show

Commit Message

Alan Modra Feb. 12, 2015, 10:10 p.m. UTC
On Thu, Feb 12, 2015 at 10:04:45AM -0500, David Edelsohn wrote:
> On Thu, Feb 12, 2015 at 7:33 AM, Alan Modra <amodra@gmail.com> wrote:
> >         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Use addsi3_carry
> >         or adddi3_carry when restoring frame_reg_rtx from r0 after restvr.
> 
> Okay.

Committed revision 220665.  I also intend to commit the following as
obvious when stage1 opens, to fix a bug in code I contributed.  It's
not a regression nor is the generated code incorrect, but we have one
unnecessary instruction.

Comments

David Edelsohn Feb. 13, 2015, 12:01 a.m. UTC | #1
On Thu, Feb 12, 2015 at 5:10 PM, Alan Modra <amodra@gmail.com> wrote:
> On Thu, Feb 12, 2015 at 10:04:45AM -0500, David Edelsohn wrote:
>> On Thu, Feb 12, 2015 at 7:33 AM, Alan Modra <amodra@gmail.com> wrote:
>> >         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Use addsi3_carry
>> >         or adddi3_carry when restoring frame_reg_rtx from r0 after restvr.
>>
>> Okay.
>
> Committed revision 220665.  I also intend to commit the following as
> obvious when stage1 opens, to fix a bug in code I contributed.  It's
> not a regression nor is the generated code incorrect, but we have one
> unnecessary instruction.

>         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Fix typo in
>         code setting up r11 for out-of-line fp restore.

Go ahead and commit the fix now.

Thanks, David
Alan Modra Feb. 13, 2015, 12:23 a.m. UTC | #2
On Thu, Feb 12, 2015 at 07:01:12PM -0500, David Edelsohn wrote:
> On Thu, Feb 12, 2015 at 5:10 PM, Alan Modra <amodra@gmail.com> wrote:
> > On Thu, Feb 12, 2015 at 10:04:45AM -0500, David Edelsohn wrote:
> >> On Thu, Feb 12, 2015 at 7:33 AM, Alan Modra <amodra@gmail.com> wrote:
> >> >         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Use addsi3_carry
> >> >         or adddi3_carry when restoring frame_reg_rtx from r0 after restvr.
> >>
> >> Okay.
> >
> > Committed revision 220665.  I also intend to commit the following as
> > obvious when stage1 opens, to fix a bug in code I contributed.  It's
> > not a regression nor is the generated code incorrect, but we have one
> > unnecessary instruction.
> 
> >         * config/rs6000/rs6000.c (rs6000_emit_epilogue): Fix typo in
> >         code setting up r11 for out-of-line fp restore.
> 
> Go ahead and commit the fix now.

OK, thanks.  Done after bootstrap etc., revision 220672.
diff mbox

Patch

--- /tmp/savres.s	2015-02-12 22:29:05.598357377 +1030
+++ savres.s	2015-02-13 08:26:49.437565909 +1030
@@ -1916,11 +1916,10 @@ 
 	lwz 11,0(1)
 	addi 0,11,-48
 	bl _restvr_26
-	addic 11,0,16
-	lwz 12,-12(11)
-	lwz 30,-8(11)
-	lwz 31,-4(11)
-	addi 11,11,32
+	addic 11,0,48
+	lwz 12,-44(11)
+	lwz 30,-40(11)
+	lwz 31,-36(11)
 	mtcrf 32,12
 	b _restfpr_28_x
 	.size	b_cvfr,.-b_cvfr
@@ -1966,10 +1965,9 @@ 
 	lwz 11,0(1)
 	addi 0,11,-48
 	bl _restvr_26
-	addic 11,0,16
-	lwz 30,-8(11)
-	lwz 31,-4(11)
-	addi 11,11,32
+	addic 11,0,48
+	lwz 30,-40(11)
+	lwz 31,-36(11)
 	b _restfpr_28_x
 	.size	b_vfr,.-b_vfr
 	.align 2

	* config/rs6000/rs6000.c (rs6000_emit_epilogue): Fix typo in
	code setting up r11 for out-of-line fp restore.

Index: gcc/config/rs6000/rs6000.c
===================================================================
--- gcc/config/rs6000/rs6000.c	(revision 220665)
+++ gcc/config/rs6000/rs6000.c	(working copy)
@@ -24966,7 +24966,7 @@  rs6000_emit_epilogue (int sibcall)
 		  bool lr = !(strategy & REST_NOINLINE_FPRS_DOESNT_RESTORE_LR);
 		  int sel = SAVRES_FPR | (lr ? SAVRES_LR : 0);
 		  newptr_regno = ptr_regno_for_savres (sel);
-		  end_save = info->gp_save_offset + info->gp_size;
+		  end_save = info->fp_save_offset + info->fp_size;
 		}
 
 	      if (newptr_regno != 1 && REGNO (frame_reg_rtx) != newptr_regno)