Commit 69b18163 by Christian Bruel Committed by Christian Bruel

fix PR target/42841

From-SVN: r156229
parent 79b754d4
2010-01-25 Christian Bruel <christian.bruel@st.com>
PR target/42841
* config/sh/sh.c (find_barrier): Increase length for non delayed
conditional branches.
(sh_insn_length_adjustment): Use JUMP_TABLE_DATA_P.
2010-01-24 David S. Miller <davem@davemloft.net> 2010-01-24 David S. Miller <davem@davemloft.net>
* gcc/config/sparc/sysv4.h (TARGET_ASM_NAMED_SECTION): Only * gcc/config/sparc/sysv4.h (TARGET_ASM_NAMED_SECTION): Only
......
...@@ -4567,6 +4567,13 @@ find_barrier (int num_mova, rtx mova, rtx from) ...@@ -4567,6 +4567,13 @@ find_barrier (int num_mova, rtx mova, rtx from)
&& ! TARGET_SMALLCODE) && ! TARGET_SMALLCODE)
new_align = 4; new_align = 4;
/* There is a possibility that a bf is transformed into a bf/s by the
delay slot scheduler. */
if (JUMP_P (from) && !JUMP_TABLE_DATA_P (from)
&& get_attr_type (from) == TYPE_CBRANCH
&& GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (from)))) != SEQUENCE)
inc += 2;
if (found_si) if (found_si)
{ {
count_si += inc; count_si += inc;
...@@ -9271,9 +9278,7 @@ sh_insn_length_adjustment (rtx insn) ...@@ -9271,9 +9278,7 @@ sh_insn_length_adjustment (rtx insn)
&& GET_CODE (PATTERN (insn)) != USE && GET_CODE (PATTERN (insn)) != USE
&& GET_CODE (PATTERN (insn)) != CLOBBER) && GET_CODE (PATTERN (insn)) != CLOBBER)
|| CALL_P (insn) || CALL_P (insn)
|| (JUMP_P (insn) || (JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)))
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
&& GET_CODE (PATTERN (insn)) != ADDR_VEC))
&& GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE
&& get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES) && get_attr_needs_delay_slot (insn) == NEEDS_DELAY_SLOT_YES)
return 2; return 2;
...@@ -9281,9 +9286,7 @@ sh_insn_length_adjustment (rtx insn) ...@@ -9281,9 +9286,7 @@ sh_insn_length_adjustment (rtx insn)
/* SH2e has a bug that prevents the use of annulled branches, so if /* SH2e has a bug that prevents the use of annulled branches, so if
the delay slot is not filled, we'll have to put a NOP in it. */ the delay slot is not filled, we'll have to put a NOP in it. */
if (sh_cpu_attr == CPU_SH2E if (sh_cpu_attr == CPU_SH2E
&& JUMP_P (insn) && JUMP_P (insn) && !JUMP_TABLE_DATA_P (insn)
&& GET_CODE (PATTERN (insn)) != ADDR_DIFF_VEC
&& GET_CODE (PATTERN (insn)) != ADDR_VEC
&& get_attr_type (insn) == TYPE_CBRANCH && get_attr_type (insn) == TYPE_CBRANCH
&& GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE) && GET_CODE (PATTERN (NEXT_INSN (PREV_INSN (insn)))) != SEQUENCE)
return 2; return 2;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment