aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/config/spu/spu.c19
2 files changed, 25 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 013c0fc..b8d331b 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,11 @@
2009-04-27 Trevor Smigiel <trevor_smigiel@playstation.sony.com>
+ * spu.c (spu_machine_dependent_reorg): Make sure branch label on hint
+ instruction is correct.
+
+
+2009-04-27 Trevor Smigiel <trevor_smigiel@playstation.sony.com>
+
Allow non-constant arguments to conversion intrinsics.
* spu-protos.h (exp2_immediate_p, spu_gen_exp2): Declare.
* predicates.md (spu_inv_exp2_operand, spu_exp2_operand): New.
diff --git a/gcc/config/spu/spu.c b/gcc/config/spu/spu.c
index 56abdf8..20d769e 100644
--- a/gcc/config/spu/spu.c
+++ b/gcc/config/spu/spu.c
@@ -2764,6 +2764,25 @@ spu_machine_dependent_reorg (void)
pad_bb ();
+ for (insn = get_insns (); insn; insn = NEXT_INSN (insn))
+ if (NONJUMP_INSN_P (insn) && INSN_CODE (insn) == CODE_FOR_hbr)
+ {
+ /* Adjust the LABEL_REF in a hint when we have inserted a nop
+ between its branch label and the branch . We don't move the
+ label because GCC expects it at the beginning of the block. */
+ rtx unspec = SET_SRC (XVECEXP (PATTERN (insn), 0, 0));
+ rtx label_ref = XVECEXP (unspec, 0, 0);
+ rtx label = XEXP (label_ref, 0);
+ rtx branch;
+ int offset = 0;
+ for (branch = NEXT_INSN (label);
+ !JUMP_P (branch) && !CALL_P (branch);
+ branch = NEXT_INSN (branch))
+ if (NONJUMP_INSN_P (branch))
+ offset += get_attr_length (branch);
+ if (offset > 0)
+ XVECEXP (unspec, 0, 0) = plus_constant (label_ref, offset);
+ }
if (spu_flag_var_tracking)
{