re PR middle-end/17416 (stack variable merging doesn't work)
authorRichard Henderson <rth@redhat.com>
Sat, 11 Sep 2004 20:07:11 +0000 (13:07 -0700)
committerRichard Henderson <rth@gcc.gnu.org>
Sat, 11 Sep 2004 20:07:11 +0000 (13:07 -0700)
        PR middle-end/17416
        * cfgexpand.c (expand_used_vars_for_block): Fix off-by-one bug
        in conflict loop.

From-SVN: r87366

gcc/ChangeLog
gcc/cfgexpand.c

index e0c197a9cd7fd1dd990299c6e4c0b73029ed9fc5..0e371fa6ab463d4d3d2a296a90716b7dfa06afe1 100644 (file)
@@ -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.
index b73445d0b184adc744cad9fe6a2b9ba8a05c34ad..71dd039ca317ce13d4d9d4da05e0f02ebf92bb93 100644 (file)
@@ -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);
     }
 }