aboutsummaryrefslogtreecommitdiff
path: root/gcc/builtins.def
diff options
context:
space:
mode:
authorAlexandre Oliva <oliva@adacore.com>2025-01-10 09:32:33 -0300
committerAlexandre Oliva <oliva@gnu.org>2025-01-10 09:40:39 -0300
commitc96a6c2c264776d8138c6b303d005e74f047cfa0 (patch)
treedb2c01d6bb570352e42dee6993c46390510e7e3c /gcc/builtins.def
parentd3c91b0439f67a6dc20ebb3bee4eeaf436eb7190 (diff)
downloadgcc-c96a6c2c264776d8138c6b303d005e74f047cfa0.zip
gcc-c96a6c2c264776d8138c6b303d005e74f047cfa0.tar.gz
gcc-c96a6c2c264776d8138c6b303d005e74f047cfa0.tar.bz2
[ifcombine] adjust for narrowing converts before shifts [PR118206]
A narrowing conversion and a shift both drop bits from the loaded value, but we need to take into account which one comes first to get the right number of bits and mask. Fold when applying masks to parts, comparing the parts, and combining the results, in the odd chance either mask happens to be zero. for gcc/ChangeLog PR tree-optimization/118206 * gimple-fold.cc (decode_field_reference): Account for upper bits dropped by narrowing conversions whether before or after a right shift. (fold_truth_andor_for_ifcombine): Fold masks, compares, and combined results. for gcc/testsuite/ChangeLog PR tree-optimization/118206 * gcc.dg/field-merge-18.c: New.
Diffstat (limited to 'gcc/builtins.def')
0 files changed, 0 insertions, 0 deletions