diff mbox

[5,regression,PR,target/64889/] Fix incorrect setting of RTX_FRAME_RELATED_P on H8/300 port

Message ID 54D4CEDF.1050301@redhat.com
State New
Headers show

Commit Message

Jeff Law Feb. 6, 2015, 2:25 p.m. UTC
The H8/300 port is setting RTX_FRAME_RELATED_P on random insns outside 
the prologue/epilogue.  That is causing dwarf2cfi heartburn as seen by 
PR64889 (and its dup 64602).

This patch avoids setting RTX_FRAME_RELATED_P on those random insns. 
The H8/300 port can now build libssp properly (64602).  Given this bug 
shows up in a standard build, I am not including a separate testcase for it.

Built gcc, & newlib on the h8300, then ran the gcc testsuite for 
h8300-elf-sim{,-mh/-mint32,-ms/-mint32} with no regressions.

Installed on the trunk.

jeff
commit 2bae6e680faeb2ae31ea9cb7ebeffc073f9617c1
Author: Jeff Law <law@redhat.com>
Date:   Fri Feb 6 07:15:51 2015 -0700

    	PR target/64889
    	* config/h8300/h8300.c (push): New argument "in_prologue".
    	Pass "in_prologue" along to "F".
    	(h8300_push_pop): Corresponding changes.
    	(h8300_expand_prologue): Likewise.
    	(h8300_swap_into_er6): Likewise.  Do not set RTX_FRAME_RELATED_P.
diff mbox

Patch

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3a5d7a2..41a824d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,12 @@ 
+2015-02-06  Jeff Law  <law@redhat.com>
+
+	PR target/64889
+	* config/h8300/h8300.c (push): New argument "in_prologue".
+	Pass "in_prologue" along to "F".
+	(h8300_push_pop): Corresponding changes.
+	(h8300_expand_prologue): Likewise.
+	(h8300_swap_into_er6): Likewise.  Do not set RTX_FRAME_RELATED_P.
+		
 2015-02-06  Jakub Jelinek  <jakub@redhat.com>
 
 	PR rtl-optimization/64957
@@ -11,6 +20,7 @@ 
 	* tree-ssa-loop-ivopts.c (get_shiftadd_cost): Use the mininum of costs
 	of shift-add and (add + shift) operations.  Rename local variable.
 
+
 2015-02-05  Jeff Law  <law@redhat.com>
 
 	PR target/17306
diff --git a/gcc/config/h8300/h8300.c b/gcc/config/h8300/h8300.c
index ea90052..4e9110e 100644
--- a/gcc/config/h8300/h8300.c
+++ b/gcc/config/h8300/h8300.c
@@ -619,7 +619,7 @@  compute_saved_regs (void)
 /* Emit an insn to push register RN.  */
 
 static rtx
-push (int rn)
+push (int rn, bool in_prologue)
 {
   rtx reg = gen_rtx_REG (word_mode, rn);
   rtx x;
@@ -630,7 +630,7 @@  push (int rn)
     x = gen_push_h8300hs_advanced (reg);
   else
     x = gen_push_h8300hs_normal (reg);
-  x = F (emit_insn (x), true);
+  x = F (emit_insn (x), in_prologue);
   add_reg_note (x, REG_INC, stack_pointer_rtx);
   return x;
 }
@@ -683,7 +683,7 @@  h8300_push_pop (int regno, int nregs, bool pop_p, bool return_p)
       if (pop_p)
 	pop (regno);
       else
-	push (regno);
+	push (regno, false);
       return;
     }
 
@@ -868,7 +868,7 @@  h8300_expand_prologue (void)
   if (frame_pointer_needed)
     {
       /* Push fp.  */
-      push (HARD_FRAME_POINTER_REGNUM);
+      push (HARD_FRAME_POINTER_REGNUM, true);
       F (emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx), true);
     }
 
@@ -2757,7 +2757,7 @@  h8sx_emit_movmd (rtx dest, rtx src, rtx length,
 void
 h8300_swap_into_er6 (rtx addr)
 {
-  rtx insn = push (HARD_FRAME_POINTER_REGNUM);
+  rtx insn = push (HARD_FRAME_POINTER_REGNUM, false);
   if (frame_pointer_needed)
     add_reg_note (insn, REG_CFA_DEF_CFA,
 		  plus_constant (Pmode, gen_rtx_MEM (Pmode, stack_pointer_rtx),
@@ -2786,7 +2786,6 @@  h8300_swap_out_of_er6 (rtx addr)
     emit_move_insn (addr, hard_frame_pointer_rtx);
 
   insn = pop (HARD_FRAME_POINTER_REGNUM);
-  RTX_FRAME_RELATED_P (insn) = 1;
   if (frame_pointer_needed)
     add_reg_note (insn, REG_CFA_DEF_CFA,
 		  plus_constant (Pmode, hard_frame_pointer_rtx,