avr.c (avr_can_eliminate): Allow elimination from ARG_POINTER_REGNUM to STACK_POINTER...
authorJoern Rennecke <joern.rennecke@embecosm.com>
Sat, 22 Feb 2014 20:24:08 +0000 (20:24 +0000)
committerJoern Rennecke <amylaar@gcc.gnu.org>
Sat, 22 Feb 2014 20:24:08 +0000 (20:24 +0000)
        * config/avr/avr.c (avr_can_eliminate): Allow elimination from
        ARG_POINTER_REGNUM
        to STACK_POINTER_REGNUM if !frame_pointer_needed.
        * config/avr/avr.c (ELIMINABLE_REGS): Add elimination from
        ARG_POINTER_REGNUM to STACK_POINTER_REGNUM.

From-SVN: r208045

gcc/ChangeLog
gcc/config/avr/avr.c
gcc/config/avr/avr.h

index 2461e46..8ee5a2b 100644 (file)
@@ -1,3 +1,11 @@
+2014-02-22  Joern Rennecke  <joern.rennecke@embecosm.com>
+
+       * config/avr/avr.c (avr_can_eliminate): Allow elimination from
+       ARG_POINTER_REGNUM
+       to STACK_POINTER_REGNUM if !frame_pointer_needed.
+       * config/avr/avr.c (ELIMINABLE_REGS): Add elimination from
+       ARG_POINTER_REGNUM to STACK_POINTER_REGNUM.
+
 2014-02-21  Vladimir Makarov  <vmakarov@redhat.com>
 
        PR target/60298
index 76d2358..cbfa4b7 100644 (file)
@@ -734,11 +734,8 @@ avr_allocate_stack_slots_for_args (void)
 static bool
 avr_can_eliminate (const int from, const int to)
 {
-  return ((from == ARG_POINTER_REGNUM && to == FRAME_POINTER_REGNUM)
-          || (frame_pointer_needed && to == FRAME_POINTER_REGNUM)
-          || ((from == FRAME_POINTER_REGNUM
-               || from == FRAME_POINTER_REGNUM + 1)
-              && !frame_pointer_needed));
+  return ((frame_pointer_needed && to == FRAME_POINTER_REGNUM)
+          || !frame_pointer_needed);
 }
 
 
index 75c42ee..74be83c 100644 (file)
@@ -306,6 +306,7 @@ enum reg_class {
 #define STATIC_CHAIN_REGNUM 2
 
 #define ELIMINABLE_REGS {                                      \
+      {ARG_POINTER_REGNUM, STACK_POINTER_REGNUM},              \
       {ARG_POINTER_REGNUM, FRAME_POINTER_REGNUM},              \
        {FRAME_POINTER_REGNUM, STACK_POINTER_REGNUM}            \
        ,{FRAME_POINTER_REGNUM+1,STACK_POINTER_REGNUM+1}}