aboutsummaryrefslogtreecommitdiff
path: root/gcc/cselib.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2011-06-27 18:45:49 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2011-06-27 18:45:49 +0200
commitdc2a58daabf95cfac0dd346ff717902bdc6e3d93 (patch)
treea3d72f8f9a1d0c760b61bcb06274339f53519f22 /gcc/cselib.c
parent0d72f628a4f21a869cb0dba9bbf45be1b17e625d (diff)
downloadgcc-dc2a58daabf95cfac0dd346ff717902bdc6e3d93.zip
gcc-dc2a58daabf95cfac0dd346ff717902bdc6e3d93.tar.gz
gcc-dc2a58daabf95cfac0dd346ff717902bdc6e3d93.tar.bz2
re PR debug/49544 (ICE in new_elt_loc_list)
PR debug/49544 * cselib.c (promote_debug_loc): If cselib_preserve_constants and l has two DEBUG_INSN owned locs instead of just one, adjust the second location's setting_insn too. * gcc.dg/pr49544.c: New test. From-SVN: r175540
Diffstat (limited to 'gcc/cselib.c')
-rw-r--r--gcc/cselib.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/gcc/cselib.c b/gcc/cselib.c
index e575aff..b96c0cd 100644
--- a/gcc/cselib.c
+++ b/gcc/cselib.c
@@ -257,7 +257,15 @@ promote_debug_loc (struct elt_loc_list *l)
{
n_debug_values--;
l->setting_insn = cselib_current_insn;
- gcc_assert (!l->next || cselib_preserve_constants);
+ if (cselib_preserve_constants && l->next)
+ {
+ gcc_assert (l->next->setting_insn
+ && DEBUG_INSN_P (l->next->setting_insn)
+ && !l->next->next);
+ l->next->setting_insn = cselib_current_insn;
+ }
+ else
+ gcc_assert (!l->next);
}
}