]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/52741 ([avr] -mtiny-stack must not make assumptions on upper 8 bits...
authorGeorg-Johann Lay <avr@gjlay.de>
Wed, 28 Mar 2012 10:06:51 +0000 (10:06 +0000)
committerGeorg-Johann Lay <gjl@gcc.gnu.org>
Wed, 28 Mar 2012 10:06:51 +0000 (10:06 +0000)
PR target/52741
Revert r181936 from 2011-12-02 for:
* config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__)
* config/avr/avr.md (movhi_sp_r_irq_off, movhi_sp_r_irq_on)
* config/avr/avr.c (output_movhi, avr_file_start)

From-SVN: r185912

gcc/ChangeLog
gcc/config/avr/avr.c
gcc/config/avr/avr.md
gcc/config/avr/libgcc.S

index 8de185cf6622e2e95c553ecc77f9bc18a8ce5017..8e584feeffe625158ae18feb77b3d1689ab26ad8 100644 (file)
@@ -1,3 +1,12 @@
+2012-03-28  Georg-Johann Lay  <avr@gjlay.de>
+
+       PR target/52741
+
+       Revert r181936 from 2011-12-02 for:
+       * config/avr/libgcc.S (__prologue_saves__, __epilogue_restores__)
+       * config/avr/avr.md (movhi_sp_r_irq_off, movhi_sp_r_irq_on)
+       * config/avr/avr.c (output_movhi, avr_file_start)
+       
 2012-03-28  Jakub Jelinek  <jakub@redhat.com>
 
        PR target/52736
index 6c4b517ee30da7f94124c13e72fe4878f72da6e9..afba77909e9e0f78d17d843aa59be228a98e6e35 100644 (file)
@@ -1879,12 +1879,9 @@ output_movhi (rtx insn, rtx operands[], int *l)
            }
          else if (test_hard_reg_class (STACK_REG, src))
            {
-              *l = 2;
-              return AVR_HAVE_8BIT_SP
-                ? (AS2 (in,%A0,__SP_L__) CR_TAB
-                   AS1 (clr,%B0))
-                : (AS2 (in,%A0,__SP_L__) CR_TAB
-                   AS2 (in,%B0,__SP_H__));
+             *l = 2;   
+             return (AS2 (in,%A0,__SP_L__) CR_TAB
+                     AS2 (in,%B0,__SP_H__));
            }
 
          if (AVR_HAVE_MOVW)
@@ -5177,10 +5174,9 @@ avr_file_start (void)
 
   default_file_start ();
 
-  fputs ("__SREG__ = 0x3f\n", asm_out_file);
-  if (!AVR_HAVE_8BIT_SP)
-    fputs ("__SP_H__ = 0x3e\n", asm_out_file);
-  fputs ("__SP_L__ = 0x3d\n", asm_out_file);
+  fputs ("__SREG__ = 0x3f\n"
+        "__SP_H__ = 0x3e\n"
+        "__SP_L__ = 0x3d\n", asm_out_file);
   
   fputs ("__tmp_reg__ = 0\n" 
          "__zero_reg__ = 1\n", asm_out_file);
index bff4f6eb2fac8699780df4be939e682e73de0df4..1fc6fee57d51034b51d610777efc4e992b583ebd 100644 (file)
   [(set (match_operand:HI 0 "stack_register_operand" "=q")
         (unspec_volatile:HI [(match_operand:HI 1 "register_operand"  "r")] 
                            UNSPECV_WRITE_SP_IRQ_OFF))]
-  "!AVR_HAVE_8BIT_SP"
+  ""
   "out __SP_H__, %B1
        out __SP_L__, %A1"
   [(set_attr "length" "2")
   [(set (match_operand:HI 0 "stack_register_operand" "=q")
         (unspec_volatile:HI [(match_operand:HI 1 "register_operand"  "r")] 
                            UNSPECV_WRITE_SP_IRQ_ON))]
-  "!AVR_HAVE_8BIT_SP"
+  ""
   "cli
         out __SP_H__, %B1
        sei
index 89bd378cf244fbe589393641f6a4419c36c9bf85..ac8e5cd94da0d38a585674f3601dda6277f45889 100644 (file)
@@ -582,15 +582,6 @@ __prologue_saves__:
        push r17
        push r28
        push r29
-#if defined (__AVR_HAVE_8BIT_SP__)
-;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level
-;;        so this lines are dead code.  To make it work, devices without
-;;        SP_H must get their own multilib(s), see PR51345.
-       in      r28,__SP_L__
-       sub     r28,r26
-       clr     r29
-       out     __SP_L__,r28
-#else
        in      r28,__SP_L__
        in      r29,__SP_H__
        sub     r28,r26
@@ -600,7 +591,6 @@ __prologue_saves__:
        out     __SP_H__,r29
        out     __SREG__,__tmp_reg__
        out     __SP_L__,r28
-#endif
 #if defined (__AVR_HAVE_EIJMP_EICALL__)
        eijmp
 #else
@@ -635,15 +625,6 @@ __epilogue_restores__:
        ldd     r16,Y+4
        ldd     r17,Y+3
        ldd     r26,Y+2
-#if defined (__AVR_HAVE_8BIT_SP__)
-;; FIXME: __AVR_HAVE_8BIT_SP__ is set on device level, not on core level
-;;        so this lines are dead code.  To make it work, devices without
-;;        SP_H must get their own multilib(s).
-       ldd     r29,Y+1
-       add     r28,r30
-       out     __SP_L__,r28
-       mov     r28, r26
-#else
        ldd     r27,Y+1
        add     r28,r30
        adc     r29,__zero_reg__
@@ -654,7 +635,6 @@ __epilogue_restores__:
        out     __SP_L__,r28
        mov_l   r28, r26
        mov_h   r29, r27
-#endif
        ret
 .endfunc
 #endif /* defined (L_epilogue) */