On Tue, 4 Feb 2014, Jakub Jelinek wrote:

> On Tue, Feb 04, 2014 at 01:57:19PM +0100, Richard Biener wrote:
> > > @@ -1691,6 +1691,13 @@ vect_finish_stmt_generation (gimple stmt
> > >      }
> > >  
> > >    gimple_set_location (vec_stmt, gimple_location (stmt));
> > > +
> > > +  /* While EH edges will generally prevent vectorization, stmt might
> > > +     e.g. be in a must-not-throw region.  Ensure newly created stmts
> > > +     that could throw are part of the same region.  */
> > > +  int lp_nr = lookup_stmt_eh_lp (stmt);
> > > +  if (lp_nr != 0 && stmt_could_throw_p (vec_stmt))
> > > +    add_stmt_to_eh_lp (vec_stmt, lp_nr);
> > 
> > Can you instead use maybe_clean_or_replace_eh_stmt (stmt, vec_stmt)?
> > That should (maybe) take care of the missed DCE as well (maybe only
> > for the first scalar stmt though).
> 
> No, because you can have several vec_stmts that could throw created
> for a single scalar stmt that can throw.  By doing
> maybe_clean_or_replace_eh_stmt the EH will be moved on the first
> vec_stmt and the rest of stmts will not be added to the region,
> furthermore, the scalar stmt which still remains in the IL will
> not be in the EH table anymore either (the vectorizer apparently has
> code to make scalar stmts used even after vectorization, not sure
> if it can happen for loads/stores).
> 
> If/when the scalar stmt is removed (right now just stores), it
> is removed from the EH tables.

Hmm, I see.  Patch is ok then.

Thanks,
Richard.

Reply via email to