diff options
author | Jeff Law <jlaw@ventanamicro.com> | 2024-07-12 13:11:33 -0600 |
---|---|---|
committer | Jeff Law <jlaw@ventanamicro.com> | 2024-07-12 13:13:23 -0600 |
commit | a6f551d079de1d151b272bcdd3d42316857c9d4e (patch) | |
tree | 582c641db7d0cfd1a54b57bcb50957679ca2c5f8 | |
parent | b3d4a021eff6353a099f800857d3080a7cd27003 (diff) | |
download | gcc-a6f551d079de1d151b272bcdd3d42316857c9d4e.zip gcc-a6f551d079de1d151b272bcdd3d42316857c9d4e.tar.gz gcc-a6f551d079de1d151b272bcdd3d42316857c9d4e.tar.bz2 |
[PR rtl-optimization/115876] Fix one of two ubsan reported issues in new ext-dce.cc code
David Binderman did a bootstrap build with ubsan enabled which triggered a few
errors in the new ext-dce.cc code. This fixes the trivial case of shifting
negative values.
Bootstrapped and regression tested on x86.
Pushing to the trunk.
gcc/
PR rtl-optimization/115876
* ext-dce.cc (carry_backpropagate): Make mask and mmask unsigned.
-rw-r--r-- | gcc/ext-dce.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc index adc9084..91789d2 100644 --- a/gcc/ext-dce.cc +++ b/gcc/ext-dce.cc @@ -374,13 +374,13 @@ binop_implies_op2_fully_live (rtx_code code) exclusively pertain to the first operand. */ HOST_WIDE_INT -carry_backpropagate (HOST_WIDE_INT mask, enum rtx_code code, rtx x) +carry_backpropagate (unsigned HOST_WIDE_INT mask, enum rtx_code code, rtx x) { if (mask == 0) return 0; enum machine_mode mode = GET_MODE_INNER (GET_MODE (x)); - HOST_WIDE_INT mmask = GET_MODE_MASK (mode); + unsigned HOST_WIDE_INT mmask = GET_MODE_MASK (mode); switch (code) { case PLUS: |