diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 79160b66f77..050756d9fd6 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,13 @@ +2012-09-30 Eric Botcazou + + * reorg.c (relax_delay_slots): Use delay_insn consistently. + + * config/sparc/sparc.c (gen_stack_pointer_dec): Delete. + (sparc_expand_epilogue): Use gen_stack_pointer_inc and adjust. + (sparc_flat_expand_epilogue): Likewise. + (emit_and_preserve): Likewise. + (sparc_fold_builtin): Fix thinko in latest change. + 2012-09-30 Andreas Schwab * config/m68k/m68k.md: Add names to bitfield insert and extract diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c index 32ac9f3b5b6..8849c03a90a 100644 --- a/gcc/config/sparc/sparc.c +++ b/gcc/config/sparc/sparc.c @@ -4976,18 +4976,6 @@ gen_stack_pointer_inc (rtx increment) increment)); } -/* Generate a decrement for the stack pointer. */ - -static rtx -gen_stack_pointer_dec (rtx decrement) -{ - return gen_rtx_SET (VOIDmode, - stack_pointer_rtx, - gen_rtx_MINUS (Pmode, - stack_pointer_rtx, - decrement)); -} - /* Expand the function prologue. The prologue is responsible for reserving storage for the frame, saving the call-saved registers and loading the GOT register if needed. */ @@ -5258,17 +5246,17 @@ sparc_expand_epilogue (bool for_eh) else if (sparc_leaf_function_p) { if (size <= 4096) - emit_insn (gen_stack_pointer_dec (GEN_INT (-size))); + emit_insn (gen_stack_pointer_inc (GEN_INT (size))); else if (size <= 8192) { - emit_insn (gen_stack_pointer_dec (GEN_INT (-4096))); - emit_insn (gen_stack_pointer_dec (GEN_INT (4096 - size))); + emit_insn (gen_stack_pointer_inc (GEN_INT (4096))); + emit_insn (gen_stack_pointer_inc (GEN_INT (size - 4096))); } else { rtx reg = gen_rtx_REG (Pmode, 1); - emit_move_insn (reg, GEN_INT (-size)); - emit_insn (gen_stack_pointer_dec (reg)); + emit_move_insn (reg, GEN_INT (size)); + emit_insn (gen_stack_pointer_inc (reg)); } } } @@ -5318,17 +5306,17 @@ sparc_flat_expand_epilogue (bool for_eh) emit_insn (gen_blockage ()); if (size <= 4096) - emit_insn (gen_stack_pointer_dec (GEN_INT (-size))); + emit_insn (gen_stack_pointer_inc (GEN_INT (size))); else if (size <= 8192) { - emit_insn (gen_stack_pointer_dec (GEN_INT (-4096))); - emit_insn (gen_stack_pointer_dec (GEN_INT (4096 - size))); + emit_insn (gen_stack_pointer_inc (GEN_INT (4096))); + emit_insn (gen_stack_pointer_inc (GEN_INT (size - 4096))); } else { rtx reg = gen_rtx_REG (Pmode, 1); - emit_move_insn (reg, GEN_INT (-size)); - emit_insn (gen_stack_pointer_dec (reg)); + emit_move_insn (reg, GEN_INT (size)); + emit_insn (gen_stack_pointer_inc (reg)); } } } @@ -10131,7 +10119,7 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, && TREE_CODE (arg2) == INTEGER_CST) { bool overflow = false; - double_int di_arg2 = TREE_INT_CST (arg2); + double_int result = TREE_INT_CST (arg2); double_int tmp; unsigned i; @@ -10147,13 +10135,13 @@ sparc_fold_builtin (tree fndecl, int n_args ATTRIBUTE_UNUSED, if (tmp.is_negative ()) tmp = tmp.neg_with_overflow (&neg2_ovf); - tmp = di_arg2.add_with_sign (tmp, false, &add2_ovf); + result = result.add_with_sign (tmp, false, &add2_ovf); overflow |= neg1_ovf | neg2_ovf | add1_ovf | add2_ovf; } gcc_assert (!overflow); - return build_int_cst_wide (rtype, tmp.low, tmp.high); + return build_int_cst_wide (rtype, result.low, result.high); } default: @@ -10454,7 +10442,7 @@ emit_and_preserve (rtx seq, rtx reg, rtx reg2) = gen_rtx_MEM (word_mode, plus_constant (Pmode, stack_pointer_rtx, SPARC_STACK_BIAS + offset)); - emit_insn (gen_stack_pointer_dec (GEN_INT (size))); + emit_insn (gen_stack_pointer_inc (GEN_INT (-size))); emit_insn (gen_rtx_SET (VOIDmode, slot, reg)); if (reg2) emit_insn (gen_rtx_SET (VOIDmode, diff --git a/gcc/reorg.c b/gcc/reorg.c index f3bf15a4dd0..dd50d211532 100644 --- a/gcc/reorg.c +++ b/gcc/reorg.c @@ -3432,9 +3432,8 @@ relax_delay_slots (rtx first) reorg_redirect_jump (insn, other_target); } - /* Now look only at cases where we have filled a delay slot. */ - if (!NONJUMP_INSN_P (insn) - || GET_CODE (PATTERN (insn)) != SEQUENCE) + /* Now look only at cases where we have a filled delay slot. */ + if (!NONJUMP_INSN_P (insn) || GET_CODE (PATTERN (insn)) != SEQUENCE) continue; pat = PATTERN (insn); @@ -3494,9 +3493,8 @@ relax_delay_slots (rtx first) } /* Now look only at the cases where we have a filled JUMP_INSN. */ - if (!JUMP_P (XVECEXP (PATTERN (insn), 0, 0)) - || ! (condjump_p (XVECEXP (PATTERN (insn), 0, 0)) - || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0)))) + if (!JUMP_P (delay_insn) + || !(condjump_p (delay_insn) || condjump_in_parallel_p (delay_insn))) continue; target_label = JUMP_LABEL (delay_insn);