RFA: Allow simplification of SUBREGs involving the frame pointer during LRA

Submitted by Nick Clifton on May 3, 2013, 3:01 p.m.

Details

Message ID 87ip30umyt.fsf@redhat.com
State New
Headers show

Commit Message

Nick Clifton May 3, 2013, 3:01 p.m.
Hi Guys,

  I would like to apply the patch below to allow simplify_subreg_regno()
  to treat the frame pointer register in the same way as the stack
  pointer register when the LRA pass is running.  I found that I needed
  this whilst trying to enable LRA for the RX and RL78 targets.  (LRA is
  still not working for these targets, but this patch lets more of
  libgcc be built than before).

  No regressions noted on an i686-pc-linux-gnu toolchain built with this
  patch applied.  OK to apply ?

Cheers
  Nick

gcc/ChangeLog
2013-05-03  Nick Clifton  <nickc@redhat.com>

	* rtlanal.c (simplify_subreg_regno): Allow simplification of
	SUBREGs involving the frame pointer when running the LRA pass.

Comments

Jeff Law May 3, 2013, 3:35 p.m.
On 05/03/2013 09:01 AM, Nick Clifton wrote:
> Hi Guys,
>
>    I would like to apply the patch below to allow simplify_subreg_regno()
>    to treat the frame pointer register in the same way as the stack
>    pointer register when the LRA pass is running.  I found that I needed
>    this whilst trying to enable LRA for the RX and RL78 targets.  (LRA is
>    still not working for these targets, but this patch lets more of
>    libgcc be built than before).
>
>    No regressions noted on an i686-pc-linux-gnu toolchain built with this
>    patch applied.  OK to apply ?
>
> Cheers
>    Nick
>
> gcc/ChangeLog
> 2013-05-03  Nick Clifton  <nickc@redhat.com>
>
> 	* rtlanal.c (simplify_subreg_regno): Allow simplification of
> 	SUBREGs involving the frame pointer when running the LRA pass.
Ewwwww.

Before accepting this, I'd like to see more of the rationale behind the 
change.

jeff
Nick Clifton May 14, 2013, 3:15 p.m.
Hi Jeff,
>>    I would like to apply the patch below to allow simplify_subreg_regno()
>>    to treat the frame pointer register in the same way as the stack
>>    pointer register when the LRA pass is running.

> Ewwwww.
>
> Before accepting this, I'd like to see more of the rationale behind the
> change.

*sigh* Of course now I cannot reproduce the failure that this patch used 
to fix.  Oh well.  I withdraw the patch for now and if I can find a way 
to reproduce the problem I will post the patch again along with a more 
complete description of what is happening.

Cheers
   Nick

Patch hide | download patch | download mbox

Index: gcc/rtlanal.c
===================================================================
--- gcc/rtlanal.c	(revision 198496)
+++ gcc/rtlanal.c	(working copy)
@@ -3481,8 +3481,10 @@ 
     return -1;
 #endif
 
-  /* We shouldn't simplify stack-related registers.  */
+  /* We shouldn't simplify stack-related registers...  */
   if ((!reload_completed || frame_pointer_needed)
+      /* ...unless we are in LRA that is.  */
+      && ! lra_in_progress
       && xregno == FRAME_POINTER_REGNUM)
     return -1;