diff options
author | Andrew Pinski <apinski@marvell.com> | 2023-06-30 19:22:48 -0700 |
---|---|---|
committer | Andrew Pinski <apinski@marvell.com> | 2023-07-04 10:19:50 -0700 |
commit | 71b68cc559b5d30d07e6b507df7cc6d008f56aad (patch) | |
tree | 2b2a8246c6cf28eb2888c174c5e221a2d092eaa3 /gcc/rust/backend/rust-tree.cc | |
parent | 2e5c1b123d5bc4b7eca91f1eb2dab88d0bcdfcfa (diff) | |
download | gcc-71b68cc559b5d30d07e6b507df7cc6d008f56aad.zip gcc-71b68cc559b5d30d07e6b507df7cc6d008f56aad.tar.gz gcc-71b68cc559b5d30d07e6b507df7cc6d008f56aad.tar.bz2 |
PR 110487: `(a !=/== CST1 ? CST2 : CST3)` pattern for type safety
The problem here is we might produce some values out of the type's
min/max (and/or valid values, e.g. signed booleans). The fix is to
use an integer type which has the same precision and signedness
as the original type.
Note two_value_replacement in phiopt had the same issue in previous
versions; though I don't know if a problem will show up there.
OK? Bootstrapped and tested on x86_64-linux-gnu.
gcc/ChangeLog:
PR tree-optimization/110487
* match.pd (a !=/== CST1 ? CST2 : CST3): Always
build a nonstandard integer and use that.
Diffstat (limited to 'gcc/rust/backend/rust-tree.cc')
0 files changed, 0 insertions, 0 deletions