aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-math-opts.c
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2021-11-20 01:37:54 +0000
committerAndrew Pinski <apinski@marvell.com>2021-11-20 08:06:18 +0000
commit74faa9834a9ad208e34f67b08c854c20b0fcfe92 (patch)
treeadac44730f5fd3e571332b64031b94f110168b8c /gcc/tree-ssa-math-opts.c
parent38e4a361e79a459947540920db645f3d7fa7221a (diff)
downloadgcc-74faa9834a9ad208e34f67b08c854c20b0fcfe92.zip
gcc-74faa9834a9ad208e34f67b08c854c20b0fcfe92.tar.gz
gcc-74faa9834a9ad208e34f67b08c854c20b0fcfe92.tar.bz2
Fix tree-optimization/103220: Another missing folding of (type) X op CST where type is a nop convert
The problem here is that int_fits_type_p will return false if we just change the sign of things like -2 (or 254) so we should accept the case where we just change the sign (and not the precision) of the type. OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/103220 gcc/ChangeLog: * match.pd ((type) X bitop CST): Don't check if CST fits into the type if only the sign changes. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr103220-1.c: New test. * gcc.dg/tree-ssa/pr103220-2.c: New test. * gcc.dg/pr25530.c: Update test to check for 4294967294 in the case -2 is not matched.
Diffstat (limited to 'gcc/tree-ssa-math-opts.c')
0 files changed, 0 insertions, 0 deletions