]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/50820 ([avr] Use EIND consistently)
authorGeorg-Johann Lay <avr@gjlay.de>
Fri, 21 Oct 2011 12:48:04 +0000 (12:48 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Fri, 21 Oct 2011 12:48:04 +0000 (12:48 +0000)
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
gcc/config/avr/libgcc.S

index 6b8be05dae24943a441d52883688264ba0496b8f..ac292bc31cba709191369e1d386b3a5d906d0911 100644 (file)
@@ -1,3 +1,10 @@
+2011-10-21  Georg-Johann Lay  <avr@gjlay.de>
+
+       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  <bernds@codesourcery.com>
 
        * config/c6x/c6x.md (attr "op_pattern"): New.
index 8df3607237042092dd07ca7373a86e3bf0d87f0d..8c369c96a7717b79ec09f57655f0ab842bc1e468 100644 (file)
@@ -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