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.
/* 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;