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

--- Comment #7 from Drea Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Drea Pinski from comment #4)
> (In reply to Drea Pinski from comment #3)
> > So this looks like this is optimized due to frange work.
> > That is dom and evrp change `a<=b` into `a==b` and then ifcombine/phiopt can
> > handle that.
> 
> well not exactly because we don't combine then until reassociation because
> of:
> 
> ```
>       /* If we changed the conditions that cause a trap, we lose.  */
>       if ((ltrap || rtrap) != trap)
>         return NULL_TREE;
> ```
> 
> Which I think this should be if we had didn't have a trap, don't introduce a
> trap.
> 
> So this should be:
> ```
> if (!ltrap && !rtrap && trap)
>   return NULL_TREE;
> ```
> 
> Let me try that; that will allow phiopt to optimize it without
> reassociation. (with the fix for PR 106164).

That causes a couple of regressions:
+FAIL: gcc.dg/torture/builtin-iseqsig-1.c   -O1  execution test
+FAIL: gcc.dg/torture/builtin-iseqsig-2.c   -O1  execution test
+FAIL: gcc.dg/torture/builtin-iseqsig-3.c   -O1  execution test
+FAIL: gfortran.dg/ieee/comparisons_3.F90   -O1  execution test

I need to check and understand if that is due to the folding early or folding
during gimple passes.
Because I was thinking about delaying the change to be only during gimple.

Reply via email to