aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa.c
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2020-11-22 19:16:34 +0100
committerJakub Jelinek <jakub@redhat.com>2020-11-22 19:16:34 +0100
commitc1fb592f2c3c6b5a6616cf882ce24d30e167a646 (patch)
tree7539e06c8f43bcec10850ed0c4dbe2d01819b8aa /gcc/tree-ssa.c
parentfdd2fb172940c5fc60e1d8195b30f7ebc0e754d0 (diff)
downloadgcc-c1fb592f2c3c6b5a6616cf882ce24d30e167a646.zip
gcc-c1fb592f2c3c6b5a6616cf882ce24d30e167a646.tar.gz
gcc-c1fb592f2c3c6b5a6616cf882ce24d30e167a646.tar.bz2
widening_mul: pattern recognize further forms of __builtin_add_overflow [PR95853]
The following patch recognizes some further forms of additions with overflow checks as shown in the testcase, in particular where the unsigned addition is performed in a wider mode just to catch overflow with a > narrower_utype_max check. 2020-11-22 Jakub Jelinek <jakub@redhat.com> PR tree-optimization/95853 * tree-ssa-math-opts.c (uaddsub_overflow_check_p): Add maxval argument, if non-NULL, instead look for r > maxval or r <= maxval comparisons. (match_uaddsub_overflow): Pattern recognize even other forms of __builtin_add_overflow, in particular when addition is performed in a wider type and result compared to maximum of the narrower type. * gcc.dg/pr95853.c: New test.
Diffstat (limited to 'gcc/tree-ssa.c')
0 files changed, 0 insertions, 0 deletions