https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96373

--- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> ---
(In reply to rsand...@gcc.gnu.org from comment #1)
> I could have sworn there was a reason why we didn't do this,
> on the basis that we already failed to take FP exceptions into
> account when vectorising normal gassigns.  But I can't remember
> what the reason was now, or find any notes about it. :-(

Well, we refuse to if-convert a stmt that can possibly trap.
whilelo is like "if-conversion" here.  Not sure what's the reason
to ever excempt stmts from the while mask.

> Anyway, we have all the infrastructure to do it, so it should
> be easy to fix.

So for if-conversion it is

  if ((! gimple_vuse (stmt)
       || gimple_could_trap_p_1 (stmt, false, false)
       || ! ifcvt_memrefs_wont_trap (stmt, refs))
      && gimple_could_trap_p (stmt))
    {
      if (ifcvt_can_predicate (stmt))
        {
          gimple_set_plf (stmt, GF_PLF_2, true);
          need_to_predicate = true;
          return true;

which means for non-memory gimple_could_trap_p (stmt) - sth you can
easily check I guess.

Reply via email to