diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2024-08-17 15:10:38 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-08-17 15:10:38 -0600 |
commit | 61e179b1b363454926504fac13b554ad7f1b0f72 (patch) | |
tree | fb6ddfef8f983bdfcc15c6456d8180f242ce9afe /gcc | |
parent | efcfd1d2ad8779b5c1b41b7f702516ca1da46925 (diff) | |
download | gcc-61e179b1b363454926504fac13b554ad7f1b0f72.zip gcc-61e179b1b363454926504fac13b554ad7f1b0f72.tar.gz gcc-61e179b1b363454926504fac13b554ad7f1b0f72.tar.bz2 |
[committed] Avoid right shifting signed value on ext-dce.cc
This is analogous to a prior patch to ext-dce which fixes propagation of sign
bits, but this time for the saturating variants. I'd held off fixing those
because I wanted the time to look at that code (since we don't have a testcase
for it as far as I know).
Not surprisingly, putting an abort on that path and running an x86 bootstrap
and testsuite run, it never triggers. Of course not a lot of code tries to do
saturating shifts.
Anyway, bootstrapped and regression tested on x86_64. Pushing to the trunk.
Thanks for everyone's patience.
gcc/
* ext-dce.cc (carry_backpropagate): Cast mask to HOST_WIDE_INT before
shifting.
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ext-dce.cc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc index 97a6642..017e2de 100644 --- a/gcc/ext-dce.cc +++ b/gcc/ext-dce.cc @@ -556,7 +556,7 @@ carry_backpropagate (unsigned HOST_WIDE_INT mask, enum rtx_code code, rtx x) >> (INTVAL (XEXP (x, 1)) + (XEXP (x, 1) != const0_rtx && code == SS_ASHIFT)))) - | (mask >> INTVAL (XEXP (x, 1)))); + | ((HOST_WIDE_INT)mask >> INTVAL (XEXP (x, 1)))); } return mmask; |