From: Richard Henderson Date: Sat, 11 Sep 2004 20:07:11 +0000 (-0700) Subject: re PR middle-end/17416 (stack variable merging doesn't work) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f4a6d54edd0ad80bcad9573d1cba9ded7f7e995c;p=gcc.git 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 --- 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 + + PR middle-end/17416 + * cfgexpand.c (expand_used_vars_for_block): Fix off-by-one bug + in conflict loop. + 2004-09-11 Jan Hubicka * 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); } }