aboutsummaryrefslogtreecommitdiff
path: root/gcc/recog.h
diff options
context:
space:
mode:
authorAndrew Pinski <apinski@marvell.com>2023-08-07 00:05:21 -0700
committerAndrew Pinski <apinski@marvell.com>2023-08-08 08:41:14 -0700
commitaadc5c07feb0ab08729ab25d0d896b55860ad9e6 (patch)
treead17fe82cacf88c738c8ffe32c97246af8264f51 /gcc/recog.h
parent733e8b48cba745d80ca2d52c1e4f47d1075e30d6 (diff)
downloadgcc-aadc5c07feb0ab08729ab25d0d896b55860ad9e6.zip
gcc-aadc5c07feb0ab08729ab25d0d896b55860ad9e6.tar.gz
gcc-aadc5c07feb0ab08729ab25d0d896b55860ad9e6.tar.bz2
VR-VALUES [PR28794]: optimize compare assignments also
This patch fixes the oldish (2006) bug where VRP was not optimizing the comparison for assignments while handling them for GIMPLE_COND only. It just happens to also solves PR 103281 due to allowing to optimize `c < 1` to `c == 0` and then we get `(c == 0) == c` (which was handled by r14-2501-g285c9d04). OK? Bootstrapped and tested on x86_64-linux-gnu with no regressions. PR tree-optimization/103281 PR tree-optimization/28794 gcc/ChangeLog: * vr-values.cc (simplify_using_ranges::simplify_cond_using_ranges_1): Split out majority to ... (simplify_using_ranges::simplify_compare_using_ranges_1): Here. (simplify_using_ranges::simplify_casted_cond): Rename to ... (simplify_using_ranges::simplify_casted_compare): This and change arguments to take op0 and op1. (simplify_using_ranges::simplify_compare_assign_using_ranges_1): New method. (simplify_using_ranges::simplify): For tcc_comparison assignments call simplify_compare_assign_using_ranges_1. * vr-values.h (simplify_using_ranges): Add new methods, simplify_compare_using_ranges_1 and simplify_compare_assign_using_ranges_1. Rename simplify_casted_cond and simplify_casted_compare and update argument types. gcc/testsuite/ChangeLog: * gcc.dg/tree-ssa/pr103281-1.c: New test. * gcc.dg/tree-ssa/vrp-compare-1.c: New test.
Diffstat (limited to 'gcc/recog.h')
0 files changed, 0 insertions, 0 deletions