From: Joern Rennecke Date: Sat, 22 Feb 2014 20:24:08 +0000 (+0000) Subject: avr.c (avr_can_eliminate): Allow elimination from ARG_POINTER_REGNUM to STACK_POINTER... X-Git-Tag: releases/gcc-4.9.0~751 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8aa7d1fc653d4671aac118a625e402955bc1cd76;p=thirdparty%2Fgcc.git avr.c (avr_can_eliminate): Allow elimination from ARG_POINTER_REGNUM to STACK_POINTER_REGNUM if... * 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 2461e468b2d3..8ee5a2b2e4df 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,11 @@ +2014-02-22 Joern Rennecke + + * 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 PR target/60298 diff --git a/gcc/config/avr/avr.c b/gcc/config/avr/avr.c index 76d23581ea71..cbfa4b7c3fbe 100644 --- a/gcc/config/avr/avr.c +++ b/gcc/config/avr/avr.c @@ -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); } diff --git a/gcc/config/avr/avr.h b/gcc/config/avr/avr.h index 75c42eeccb34..74be83c8aa05 100644 --- a/gcc/config/avr/avr.h +++ b/gcc/config/avr/avr.h @@ -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}}