diff options
author | Joern Rennecke <joern.rennecke@embecosm.com> | 2011-12-09 12:57:24 +0000 |
---|---|---|
committer | Joern Rennecke <amylaar@gcc.gnu.org> | 2011-12-09 12:57:24 +0000 |
commit | 7543f91816ec7402e501d2afa09d7f18ac8bee61 (patch) | |
tree | 29604d6a37d0c504c6bb80d0d28fbabc827412ab /gcc/expmed.c | |
parent | fb5503484f7463c2a523fed993f58e58289ba59b (diff) | |
download | gcc-7543f91816ec7402e501d2afa09d7f18ac8bee61.zip gcc-7543f91816ec7402e501d2afa09d7f18ac8bee61.tar.gz gcc-7543f91816ec7402e501d2afa09d7f18ac8bee61.tar.bz2 |
re PR middle-end/40154 (internal compiler error: in do_SUBST, at combine.c:681)
PR middle-end/40154
* emit-rtl.c (set_dst_reg_note): New function.
* rtl.h (set_dst_reg_note): Declare.
* optabs.c (expand_binop, expand_absneg_bit): Use set_dst_reg_note.
(emit_libcall_block, expand_fix): Likewise.
* function.c (assign_parm_setup_reg, expand_function_start): Likewise.
* expmed.c (expand_mult_const, expand_divmod): Likewise.
* reload1.c (gen_reload): Likewise.
From-SVN: r182162
Diffstat (limited to 'gcc/expmed.c')
-rw-r--r-- | gcc/expmed.c | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/gcc/expmed.c b/gcc/expmed.c index b3e6d6d..cfa045b 100644 --- a/gcc/expmed.c +++ b/gcc/expmed.c @@ -2939,6 +2939,7 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, && !optimize) ? target : 0; rtx accum_target = optimize ? 0 : accum; + rtx accum_inner; switch (alg->op[opno]) { @@ -3004,16 +3005,18 @@ expand_mult_const (enum machine_mode mode, rtx op0, HOST_WIDE_INT val, that. */ tem = op0, nmode = mode; + accum_inner = accum; if (GET_CODE (accum) == SUBREG) { - nmode = GET_MODE (SUBREG_REG (accum)); + accum_inner = SUBREG_REG (accum); + nmode = GET_MODE (accum_inner); tem = gen_lowpart (nmode, op0); } insn = get_last_insn (); - set_unique_reg_note (insn, REG_EQUAL, - gen_rtx_MULT (nmode, tem, - GEN_INT (val_so_far))); + set_dst_reg_note (insn, REG_EQUAL, + gen_rtx_MULT (nmode, tem, GEN_INT (val_so_far)), + accum_inner); } if (variant == negate_variant) @@ -3823,7 +3826,7 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, rtx quotient = 0, remainder = 0; rtx last; int size; - rtx insn, set; + rtx insn; optab optab1, optab2; int op1_is_constant, op1_is_pow2 = 0; int max_cost, extra_cost; @@ -4127,12 +4130,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, break; insn = get_last_insn (); - if (insn != last - && (set = single_set (insn)) != 0 - && SET_DEST (set) == quotient) - set_unique_reg_note (insn, - REG_EQUAL, - gen_rtx_UDIV (compute_mode, op0, op1)); + if (insn != last) + set_dst_reg_note (insn, REG_EQUAL, + gen_rtx_UDIV (compute_mode, op0, op1), + quotient); } else /* TRUNC_DIV, signed */ { @@ -4211,18 +4212,15 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, { insn = get_last_insn (); if (insn != last - && (set = single_set (insn)) != 0 - && SET_DEST (set) == quotient && abs_d < ((unsigned HOST_WIDE_INT) 1 << (HOST_BITS_PER_WIDE_INT - 1))) - set_unique_reg_note (insn, - REG_EQUAL, - gen_rtx_DIV (compute_mode, - op0, - GEN_INT - (trunc_int_for_mode + set_dst_reg_note (insn, REG_EQUAL, + gen_rtx_DIV (compute_mode, op0, + GEN_INT + (trunc_int_for_mode (abs_d, - compute_mode)))); + compute_mode))), + quotient); quotient = expand_unop (compute_mode, neg_optab, quotient, quotient, 0); @@ -4309,12 +4307,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, break; insn = get_last_insn (); - if (insn != last - && (set = single_set (insn)) != 0 - && SET_DEST (set) == quotient) - set_unique_reg_note (insn, - REG_EQUAL, - gen_rtx_DIV (compute_mode, op0, op1)); + if (insn != last) + set_dst_reg_note (insn, REG_EQUAL, + gen_rtx_DIV (compute_mode, op0, op1), + quotient); } break; } @@ -4732,11 +4728,10 @@ expand_divmod (int rem_flag, enum tree_code code, enum machine_mode mode, NULL_RTX, 1); insn = get_last_insn (); - set_unique_reg_note (insn, - REG_EQUAL, - gen_rtx_fmt_ee (unsignedp ? UDIV : DIV, - compute_mode, - op0, op1)); + set_dst_reg_note (insn, REG_EQUAL, + gen_rtx_fmt_ee (unsignedp ? UDIV : DIV, + compute_mode, op0, op1), + quotient); } break; |