aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2022-06-01 17:54:39 +0200
committerJakub Jelinek <jakub@redhat.com>2022-06-01 17:54:39 +0200
commitcf78d8411d00e21c30512d2af895e70d38bbfb77 (patch)
tree6a8c7ebc06b7c517e35832a011c36748c16bdfe3 /gcc/ada
parent289f860fe62423a66e43989688e1d24bcdb25b5e (diff)
downloadgcc-cf78d8411d00e21c30512d2af895e70d38bbfb77.zip
gcc-cf78d8411d00e21c30512d2af895e70d38bbfb77.tar.gz
gcc-cf78d8411d00e21c30512d2af895e70d38bbfb77.tar.bz2
match.pd: Optimize __builtin_mul_overflow_p (x, cst, (utype)0) to x > ~(utype)0 / cst [PR30314]
A comparison with a constant is most likely always faster than .MUL_OVERFLOW from which we only check whether it overflowed and not the multiplication result, and even if not, it is simpler operation on GIMPLE and even if a target exists where such multiplications with overflow checking are cheaper than comparisons, because comparisons are so much more common than overflow checking multiplications, it would be nice if it simply arranged for comparisons to be emitted like those multiplications on its own... 2022-06-01 Jakub Jelinek <jakub@redhat.com> PR middle-end/30314 * match.pd (__builtin_mul_overflow_p (x, cst, (utype) 0) -> x > ~(utype)0 / cst): New simplification. * gcc.dg/tree-ssa/pr30314.c: New test.
Diffstat (limited to 'gcc/ada')
0 files changed, 0 insertions, 0 deletions