diff mbox

Fix bug in vect dumping code causing infinite loop

Message ID CAAe5K+U51T57y5RKt6b0oUqo8hieXCgZXti1yTW65VUEUh6Cbw@mail.gmail.com
State New
Headers show

Commit Message

Teresa Johnson Feb. 3, 2014, 3:29 p.m. UTC
This patch fixes a bug in the dumping code, whereby an inner loop
index variable was the same as the outer loop index variable, and the
redef caused an infinite loop.

Bootstrapped and tested on x86_64-unknown-linux-gnu. Ok for trunk?

2014-02-03  Teresa Johnson  <tejohnson@google.com>

        * tree-vect-slp.c (vect_supported_load_permutation_p): Avoid
        redef of outer loop index variable.

Comments

Richard Biener Feb. 3, 2014, 3:44 p.m. UTC | #1
On Mon, Feb 3, 2014 at 4:29 PM, Teresa Johnson <tejohnson@google.com> wrote:
> This patch fixes a bug in the dumping code, whereby an inner loop
> index variable was the same as the outer loop index variable, and the
> redef caused an infinite loop.
>
> Bootstrapped and tested on x86_64-unknown-linux-gnu. Ok for trunk?

Ok

Thanks,
Richard.

> 2014-02-03  Teresa Johnson  <tejohnson@google.com>
>
>         * tree-vect-slp.c (vect_supported_load_permutation_p): Avoid
>         redef of outer loop index variable.
>
> Index: tree-vect-slp.c
> ===================================================================
> --- tree-vect-slp.c     (revision 207344)
> +++ tree-vect-slp.c     (working copy)
> @@ -1103,8 +1103,8 @@ vect_supported_load_permutation_p (slp_instance sl
>           FOR_EACH_VEC_ELT (node->load_permutation, j, next)
>             dump_printf (MSG_NOTE, "%d ", next);
>         else
> -         for (i = 0; i < group_size; ++i)
> -           dump_printf (MSG_NOTE, "%d ", i);
> +         for (k = 0; k < group_size; ++k)
> +           dump_printf (MSG_NOTE, "%d ", k);
>        dump_printf (MSG_NOTE, "\n");
>      }
>
>
> --
> Teresa Johnson | Software Engineer | tejohnson@google.com | 408-460-2413
diff mbox

Patch

Index: tree-vect-slp.c
===================================================================
--- tree-vect-slp.c     (revision 207344)
+++ tree-vect-slp.c     (working copy)
@@ -1103,8 +1103,8 @@  vect_supported_load_permutation_p (slp_instance sl
          FOR_EACH_VEC_ELT (node->load_permutation, j, next)
            dump_printf (MSG_NOTE, "%d ", next);
        else
-         for (i = 0; i < group_size; ++i)
-           dump_printf (MSG_NOTE, "%d ", i);
+         for (k = 0; k < group_size; ++k)
+           dump_printf (MSG_NOTE, "%d ", k);
       dump_printf (MSG_NOTE, "\n");
     }