On Tue, Nov 04, 2014 at 07:36:26PM +0100, Marek Polacek wrote:
> +               FOR_EACH_VEC_ELT_REVERSE (v, i, g)
> +                 {
> +                   /* Remove statements for BBs that have been
> +                      already processed.  */
> +                   sanopt_info *si = (sanopt_info *) gimple_bb (g)->aux;
> +                   if (si->visited_p)
> +                     {
> +                       v.unordered_remove (i);
> +                       continue;
> +                     }
> +                   /* At this point we shouldn't have any statements
> +                      that aren't dominating the current BB.  */
> +                   tree align = gimple_call_arg (g, 2);
> +                   remove = tree_int_cst_le (cur_align, align);
> +                   break;
> +                 }

As you only remove last item, that is pop.
So, how about

        while (!v.is_empty ())
          {
            gimple g = v.last ();
            /* Remove statements for BBs that have been
               already processed.  */
            sanopt_info *si = (sanopt_info *) gimple_bb (g)->aux;
            if (si->visited_p)
              v.pop ();
            else
              {
                /* At this point we shouldn't have any statements
                   that aren't dominating the current BB.  */
                tree align = gimple_call_arg (g, 2);
                remove = tree_int_cst_le (cur_align, align);
                break;
              }
          }
?

The patch is ok either way.

        Jakub

Reply via email to