From d573919e7c70042a4d9d260b57ec84d10c099280 Mon Sep 17 00:00:00 2001 From: Georg-Johann Lay Date: Fri, 21 Oct 2011 12:48:04 +0000 Subject: [PATCH] re PR target/50820 ([avr] Use EIND consistently) PR target/50820 * config/avr/libgcc.S (__EIND__): New define to 0x3C. (__tablejump__): Consistently use EIND for indirect jump/call. (__tablejump_elpm__): Ditto. From-SVN: r180299 --- gcc/ChangeLog | 7 +++++++ gcc/config/avr/libgcc.S | 18 ++++++++---------- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6b8be05..ac292bc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2011-10-21 Georg-Johann Lay + + PR target/50820 + * config/avr/libgcc.S (__EIND__): New define to 0x3C. + (__tablejump__): Consistently use EIND for indirect jump/call. + (__tablejump_elpm__): Ditto. + 2011-10-21 Bernd Schmidt * config/c6x/c6x.md (attr "op_pattern"): New. diff --git a/gcc/config/avr/libgcc.S b/gcc/config/avr/libgcc.S index 8df3607..8c369c9 100644 --- a/gcc/config/avr/libgcc.S +++ b/gcc/config/avr/libgcc.S @@ -28,6 +28,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define __SP_H__ 0x3e #define __SP_L__ 0x3d #define __RAMPZ__ 0x3B +#define __EIND__ 0x3C /* Most of the functions here are called directly from avr.md patterns, instead of using the standard libcall mechanisms. @@ -821,17 +822,12 @@ ENDF __tablejump2__ DEFUN __tablejump__ #if defined (__AVR_HAVE_LPMX__) -#if defined (__AVR_HAVE_EIJMP_EICALL__) - lpm __tmp_reg__, Z+ - push __tmp_reg__ - lpm __tmp_reg__, Z - push __tmp_reg__ - push __zero_reg__ - ret -#else lpm __tmp_reg__, Z+ lpm r31, Z mov r30, __tmp_reg__ +#if defined (__AVR_HAVE_EIJMP_EICALL__) + eijmp +#else ijmp #endif @@ -842,7 +838,8 @@ DEFUN __tablejump__ lpm push r0 #if defined (__AVR_HAVE_EIJMP_EICALL__) - push __zero_reg__ + in __tmp_reg__, __EIND__ + push __tmp_reg__ #endif ret #endif /* !HAVE_LPMX */ @@ -1034,7 +1031,8 @@ DEFUN __tablejump_elpm__ elpm push r0 #if defined (__AVR_HAVE_EIJMP_EICALL__) - push __zero_reg__ + in __tmp_reg__, __EIND__ + push __tmp_reg__ #endif ret #endif -- 2.7.4