On Thu, May 05, 2022 at 11:44:59AM +0200, Richard Biener wrote:
> When we make stmts to execute unconditionally in ifcombine we have
> to make sure to rewrite stmts that can invoke undefined behavior
> on overflow into a form with defined overflow.  That's possible
> for all but signed division for which we have to avoid the transform.
> 
> Bootstrapped and tested on x86_64-unknown-linux-gnu.
> 
> This was developed as not working solution to fix PR105142 and
> I do not have a testcase that experiences wrong-code (but I only
> tried for about 10 minutes to construct one).  Still the problem
> is obviously latent and we should fix it.
> 
> Thus - OK for trunk?
> 
> Thanks,
> Richard.
> 
> 2022-04-04  Richard Biener  <rguent...@suse.de>
> 
>       * tree-ssa-ifcombine.cc (bb_no_side_effects_p): Avoid executing
>       divisions with undefined overflow unconditionally.
>       (pass_tree_ifcombine::execute): Rewrite stmts with undefined
>       overflow to defined.

LGTM.

        Jakub

Reply via email to