Commit 3232e9d8 by John David Anglin Committed by John David Anglin

pa.c (forward_branch_p): Return bool type.

	* pa.c (forward_branch_p): Return bool type.  Use instruction addresses
	when available.  Assert that INSN has a jump label.
	(pa_adjust_insn_length): Don't call forward_branch_p if INSN doesn't
	have a jump label.

From-SVN: r149141
parent 14c41b9b
2009-07-01 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
* pa.c (forward_branch_p): Return bool type. Use instruction addresses
when available. Assert that INSN has a jump label.
(pa_adjust_insn_length): Don't call forward_branch_p if INSN doesn't
have a jump label.
2009-07-01 Richard Guenther <rguenther@suse.de> 2009-07-01 Richard Guenther <rguenther@suse.de>
PR tree-optimization/19831 PR tree-optimization/19831
......
...@@ -93,7 +93,7 @@ static inline rtx force_mode (enum machine_mode, rtx); ...@@ -93,7 +93,7 @@ static inline rtx force_mode (enum machine_mode, rtx);
static void pa_reorg (void); static void pa_reorg (void);
static void pa_combine_instructions (void); static void pa_combine_instructions (void);
static int pa_can_combine_p (rtx, rtx, rtx, int, rtx, rtx, rtx); static int pa_can_combine_p (rtx, rtx, rtx, int, rtx, rtx, rtx);
static int forward_branch_p (rtx); static bool forward_branch_p (rtx);
static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *); static void compute_zdepwi_operands (unsigned HOST_WIDE_INT, unsigned *);
static int compute_movmem_length (rtx); static int compute_movmem_length (rtx);
static int compute_clrmem_length (rtx); static int compute_clrmem_length (rtx);
...@@ -4751,6 +4751,7 @@ pa_adjust_insn_length (rtx insn, int length) ...@@ -4751,6 +4751,7 @@ pa_adjust_insn_length (rtx insn, int length)
/* Adjust a short backwards conditional with an unfilled delay slot. */ /* Adjust a short backwards conditional with an unfilled delay slot. */
if (GET_CODE (pat) == SET if (GET_CODE (pat) == SET
&& length == 4 && length == 4
&& JUMP_LABEL (insn) != NULL_RTX
&& ! forward_branch_p (insn)) && ! forward_branch_p (insn))
return 4; return 4;
else if (GET_CODE (pat) == PARALLEL else if (GET_CODE (pat) == PARALLEL
...@@ -8578,22 +8579,28 @@ non_hard_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED) ...@@ -8578,22 +8579,28 @@ non_hard_reg_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
return ! (GET_CODE (op) == REG && REGNO (op) < FIRST_PSEUDO_REGISTER); return ! (GET_CODE (op) == REG && REGNO (op) < FIRST_PSEUDO_REGISTER);
} }
/* Return 1 if INSN branches forward. Should be using insn_addresses /* Return TRUE if INSN branches forward. */
to avoid walking through all the insns... */
static int static bool
forward_branch_p (rtx insn) forward_branch_p (rtx insn)
{ {
rtx label = JUMP_LABEL (insn); rtx lab = JUMP_LABEL (insn);
/* The INSN must have a jump label. */
gcc_assert (lab != NULL_RTX);
if (INSN_ADDRESSES_SET_P ())
return INSN_ADDRESSES (INSN_UID (lab)) > INSN_ADDRESSES (INSN_UID (insn));
while (insn) while (insn)
{ {
if (insn == label) if (insn == lab)
break; return true;
else else
insn = NEXT_INSN (insn); insn = NEXT_INSN (insn);
} }
return (insn == label); return false;
} }
/* Return 1 if OP is an equality comparison, else return 0. */ /* Return 1 if OP is an equality comparison, else return 0. */
......
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