aboutsummaryrefslogtreecommitdiff
path: root/gcc/range-op-float.cc
diff options
context:
space:
mode:
authorRichard Biener <rguenther@suse.de>2023-07-31 14:44:52 +0200
committerRichard Biener <rguenther@suse.de>2023-08-03 14:52:11 +0200
commit29370f1387274ad5a35a020db6a5d06c0324e6c1 (patch)
treee4810a4d72a3a5f89e55383039c607206261131f /gcc/range-op-float.cc
parent13dfb01e5c30c3bd09333ac79d6ff96a617fea67 (diff)
downloadgcc-29370f1387274ad5a35a020db6a5d06c0324e6c1.zip
gcc-29370f1387274ad5a35a020db6a5d06c0324e6c1.tar.gz
gcc-29370f1387274ad5a35a020db6a5d06c0324e6c1.tar.bz2
tree-optimization/110838 - vectorization of widened shifts
The following makes sure to limit the shift operand when vectorizing (short)((int)x >> 31) via (short)x >> 31 as the out of bounds shift operand otherwise invokes undefined behavior. When we determine whether we can demote the operand we know we at most shift in the sign bit so we can adjust the shift amount. Note this has the possibility of un-CSEing common shift operands as there's no good way to share pattern stmts between patterns. We'd have to separately pattern recognize the definition. PR tree-optimization/110838 * tree-vect-patterns.cc (vect_recog_over_widening_pattern): Adjust the shift operand of RSHIFT_EXPRs. * gcc.dg/torture/pr110838.c: New testcase.
Diffstat (limited to 'gcc/range-op-float.cc')
0 files changed, 0 insertions, 0 deletions