aboutsummaryrefslogtreecommitdiff
path: root/gcc/combine.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-04-12 12:53:47 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-04-12 12:53:47 +0200
commit74f091d686a259e096d7fb316d3a2e60623cdd3d (patch)
tree9968c5e0e6d0256753bb87b2978322b8ad68df3b /gcc/combine.c
parentf20ca7258739d74b12cf381293b10f72125732c5 (diff)
downloadgcc-74f091d686a259e096d7fb316d3a2e60623cdd3d.zip
gcc-74f091d686a259e096d7fb316d3a2e60623cdd3d.tar.gz
gcc-74f091d686a259e096d7fb316d3a2e60623cdd3d.tar.bz2
re PR rtl-optimization/48549 (Combiner ICE with -g)
PR rtl-optimization/48549 * combine.c (propagate_for_debug): Also stop after BB_END of this_basic_block. Process LAST and just stop processing after it. (combine_instructions): If last_combined_insn has been deleted, set last_combined_insn to its PREV_INSN. * g++.dg/opt/pr48549.C: New test. From-SVN: r172311
Diffstat (limited to 'gcc/combine.c')
-rw-r--r--gcc/combine.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gcc/combine.c b/gcc/combine.c
index 32a3d73..23015fd 100644
--- a/gcc/combine.c
+++ b/gcc/combine.c
@@ -1198,8 +1198,13 @@ combine_instructions (rtx f, unsigned int nregs)
next = 0;
if (NONDEBUG_INSN_P (insn))
{
+ while (last_combined_insn
+ && INSN_DELETED_P (last_combined_insn))
+ last_combined_insn = PREV_INSN (last_combined_insn);
if (last_combined_insn == NULL_RTX
- || DF_INSN_LUID (last_combined_insn) < DF_INSN_LUID (insn))
+ || BARRIER_P (last_combined_insn)
+ || BLOCK_FOR_INSN (last_combined_insn) != this_basic_block
+ || DF_INSN_LUID (last_combined_insn) <= DF_INSN_LUID (insn))
last_combined_insn = insn;
/* See if we know about function return values before this
@@ -2446,19 +2451,21 @@ propagate_for_debug_subst (rtx from, const_rtx old_rtx, void *data)
}
/* Replace all the occurrences of DEST with SRC in DEBUG_INSNs between INSN
- and LAST. */
+ and LAST, not including INSN, but including LAST. Also stop at the end
+ of THIS_BASIC_BLOCK. */
static void
propagate_for_debug (rtx insn, rtx last, rtx dest, rtx src)
{
- rtx next, loc;
+ rtx next, loc, end = NEXT_INSN (BB_END (this_basic_block));
struct rtx_subst_pair p;
p.to = src;
p.adjusted = false;
next = NEXT_INSN (insn);
- while (next != last)
+ last = NEXT_INSN (last);
+ while (next != last && next != end)
{
insn = next;
next = NEXT_INSN (insn);