aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJeff Law <jlaw@ventanamicro.com>2024-07-29 16:17:25 -0600
committerJeff Law <jlaw@ventanamicro.com>2024-07-29 16:18:30 -0600
commit5ab9a351247a551c47b0ab9d8e8b907223e7faf6 (patch)
treeda6d064c50318b87b5405f37b1d41dd84fabfb5a /gcc
parent0544db1a4f8f250edb7f25eb0fa4dcfd569ec805 (diff)
downloadgcc-5ab9a351247a551c47b0ab9d8e8b907223e7faf6.zip
gcc-5ab9a351247a551c47b0ab9d8e8b907223e7faf6.tar.gz
gcc-5ab9a351247a551c47b0ab9d8e8b907223e7faf6.tar.bz2
[target/116104] Fix test guarding UINTVAL to extract shift count
Minor oversight in the ext-dce bits. If the shift count is a constant vector, then we shouldn't be extracting values with [U]INTVAL. We guarded that test with CONSTANT_P, when it should have been CONSTANT_INT_P. Shows up on gcn, but I wouldn't be terribly surprised if it could be triggered elsewhere. Verified the testcase compiles on gcn. Haven't done a libgcc build for gcn though. Also verified x86 bootstraps and regression tests cleanly. Pushing to the trunk. PR target/116104 gcc/ * ext-dce.cc (carry_backpropagate): Fix test guarding UINTVAL extraction of shift count.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ext-dce.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/ext-dce.cc b/gcc/ext-dce.cc
index 14f163a..f7b0eb1 100644
--- a/gcc/ext-dce.cc
+++ b/gcc/ext-dce.cc
@@ -493,7 +493,7 @@ carry_backpropagate (unsigned HOST_WIDE_INT mask, enum rtx_code code, rtx x)
/* We propagate for the shifted operand, but not the shift
count. The count is handled specially. */
case ASHIFT:
- if (CONSTANT_P (XEXP (x, 1))
+ if (CONST_INT_P (XEXP (x, 1))
&& known_lt (UINTVAL (XEXP (x, 1)), GET_MODE_BITSIZE (mode)))
return (HOST_WIDE_INT)mask >> INTVAL (XEXP (x, 1));
return (2ULL << floor_log2 (mask)) - 1;