summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2004-09-11 13:07:11 -0700
committerRichard Henderson <rth@gcc.gnu.org>2004-09-11 13:07:11 -0700
commitf4a6d54edd0ad80bcad9573d1cba9ded7f7e995c (patch)
tree8c2e23decfbecbb98c4a72def6aa1886c81fad1e /gcc
parent1d1df0df43b306fef358d1d3f1378b593a75d5a9 (diff)
downloadgcc-f4a6d54edd0ad80bcad9573d1cba9ded7f7e995c.tar.gz
re PR middle-end/17416 (stack variable merging doesn't work)
PR middle-end/17416 * cfgexpand.c (expand_used_vars_for_block): Fix off-by-one bug in conflict loop. From-SVN: r87366
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/cfgexpand.c8
2 files changed, 8 insertions, 6 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index e0c197a9cd7..0e371fa6ab4 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,9 @@
+2004-09-11 Richard Henderson <rth@redhat.com>
+
+ PR middle-end/17416
+ * cfgexpand.c (expand_used_vars_for_block): Fix off-by-one bug
+ in conflict loop.
+
2004-09-11 Jan Hubicka <jh@suse.cz>
* i386.h (MODE_NEEDED): Calls need UNINITIALIZED mode; add comment.
diff --git a/gcc/cfgexpand.c b/gcc/cfgexpand.c
index b73445d0b18..71dd039ca31 100644
--- a/gcc/cfgexpand.c
+++ b/gcc/cfgexpand.c
@@ -670,12 +670,8 @@ expand_used_vars_for_block (tree block, bool toplevel)
resize_stack_vars_conflict (new_sv_num);
for (i = old_sv_num; i < new_sv_num; ++i)
- for (j = i < this_sv_num ? i : this_sv_num; ; --j)
- {
- add_stack_var_conflict (i, j);
- if (j == old_sv_num)
- break;
- }
+ for (j = i < this_sv_num ? i+1 : this_sv_num; j-- > old_sv_num ;)
+ add_stack_var_conflict (i, j);
}
}