aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/iresolve.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-06-18 12:11:09 +0200
committerGiuliano Belinassi <giuliano.belinassi@usp.br>2020-08-17 13:13:59 -0300
commit3842eb5c3d207861840b60ff9b2c0b3438491929 (patch)
tree3e7e5055f35cbd2b99e115f409a417f182116147 /gcc/fortran/iresolve.c
parent7d72e8b2324337dade52b9987d5090772489ba2d (diff)
downloadgcc-3842eb5c3d207861840b60ff9b2c0b3438491929.zip
gcc-3842eb5c3d207861840b60ff9b2c0b3438491929.tar.gz
gcc-3842eb5c3d207861840b60ff9b2c0b3438491929.tar.bz2
phiopt: Improve minmax optimization [PR95699]
As discussed in the PR, the x < 0x80000000U to (int) x >= 0 optimization stands in the way of minmax_replacement optimization, so for comparisons with most of the constants it works well, but when the above mentioned optimization triggers, it is unable to do it. The match.pd (cond (cmp (convert? x) c1) (op x c2) c3) -> (op (minmax x c1) c2) optimization is able to look through that and this patch teaches minmax_replacement about it too. 2020-06-18 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/95699 * tree-ssa-phiopt.c (minmax_replacement): Treat (signed int)x < 0 as x > INT_MAX and (signed int)x >= 0 as x <= INT_MAX. Move variable declarations to the statements that set them where possible. * gcc.dg/tree-ssa/pr95699.c: New test.
Diffstat (limited to 'gcc/fortran/iresolve.c')
0 files changed, 0 insertions, 0 deletions