[PATCH] Fix tree-optimization/103257: Missed jump threading due too early conversion of bool*A into bool?A:0

Jeff Law jeffreyalaw@gmail.com
Thu Nov 18 16:33:36 GMT 2021



On 11/17/2021 1:00 AM, apinski--- via Gcc-patches wrote:
> From: Andrew Pinski <apinski@marvell.com>
>
> So like many optimizations on the gimple level, sometimes it makes sense to do the
> optimization early or later. In this case, creating a cond expression early causes
> other optimizations to be missed.  So just disable it until canonicalize_math_p ()
> is false.
>
> OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions.
>
> 	PR tree-optimization/103257
>
> gcc/ChangeLog:
>
> 	* match.pd
> 	(((m1 >/</>=/<= m2) * d -> (m1 >/</>=/<= m2) ? d : 0):
> 	Disable until !canonicalize_math_p ().
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/tree-ssa/vrp116.c: Check optimized instead of vrp1.
> 	* gcc.dg/tree-ssa/pr103257-1.c: New test.
OK
jeff



More information about the Gcc-patches mailing list