From f4a6d54edd0ad80bcad9573d1cba9ded7f7e995c Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Sat, 11 Sep 2004 13:07:11 -0700 Subject: [PATCH] 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 --- gcc/ChangeLog | 6 ++++++ gcc/cfgexpand.c | 8 ++------ 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 + + 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); } } -- 2.30.2