avr.md ("call_prologue_saves"): Use hi8(gs())/lo8(gs()) instead of pm_lo8/pm_hi8...
authorTristan Gingold <gingold@adacore.com>
Mon, 26 May 2008 17:44:50 +0000 (17:44 +0000)
committerAnatoly Sokolov <aesok@gcc.gnu.org>
Mon, 26 May 2008 17:44:50 +0000 (21:44 +0400)
* config/avr/avr.md ("call_prologue_saves"): Use hi8(gs())/lo8(gs())
instead of pm_lo8/pm_hi8 to makes this call working on avr6.
* config/avr/avr.c (expand_prologue): Tune "call_prologue"
optimization for 'avr6' architecture.

Co-Authored-By: Anatoly Sokolov <aesok@post.ru>
From-SVN: r135953

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

index 1dd372bb559319aedcf684b1ae51d20f72663d6b..f7c7ba5ca926c7f6b64c8f0783c7ebc150c7155a 100644 (file)
@@ -1,3 +1,11 @@
+2008-05-26  Tristan Gingold  <gingold@adacore.com>
+            Anatoly Sokolov  <aesok@post.ru>
+
+       * config/avr/avr.md ("call_prologue_saves"): Use hi8(gs())/lo8(gs())
+       instead of pm_lo8/pm_hi8 to makes this call working on avr6.
+       * config/avr/avr.c (expand_prologue): Tune "call_prologue" 
+       optimization for 'avr6' architecture.
+
 2008-05-26  Andy Hutchinson  <hutchinsonandy@aim.com>
 
        PR target/34932
index 012a7e4fd1b5c5f5e89d8ae9d73d1b0f5ce7a8e9..d2cc33a0293f6258f8f5cef1e593b45a77602e8e 100644 (file)
@@ -682,7 +682,9 @@ expand_prologue (void)
       /* Prevent any attempt to delete the setting of ZERO_REG!  */
       emit_insn (gen_rtx_USE (VOIDmode, zero_reg_rtx));
     }
-  if (minimize && (frame_pointer_needed || live_seq > 6)) 
+  if (minimize && (frame_pointer_needed 
+                  || (AVR_2_BYTE_PC && live_seq > 6)
+                  || live_seq > 7)) 
     {
       insn = emit_move_insn (gen_rtx_REG (HImode, REG_X), 
                              gen_int_mode (size, HImode));
index 47042e994367b4ffa93cb2ee7745971f7ac33ec9..ffbbefa74ef4954642b673d3032b58719ae62dec 100644 (file)
    (use (reg:HI REG_X))
    (clobber (reg:HI REG_Z))]
   ""
-  "ldi r30,pm_lo8(1f)
-       ldi r31,pm_hi8(1f)
+  "ldi r30,lo8(gs(1f))
+       ldi r31,hi8(gs(1f))
        %~jmp __prologue_saves__+((18 - %0) * 2)
 1:"
   [(set_attr_alternative "length"