diff options
author | Wilco Dijkstra <wdijkstr@arm.com> | 2018-10-11 19:10:12 +0000 |
---|---|---|
committer | Wilco Dijkstra <wilco@gcc.gnu.org> | 2018-10-11 19:10:12 +0000 |
commit | 1b6acf2339201a7464d052f1909b24a64021685b (patch) | |
tree | 6d24d43466f22abcdc18d95d8f56ae8af5cf31c5 /gcc/config | |
parent | 03f6d32edb50546f1a123e848ae98a70a747b0c7 (diff) | |
download | gcc-1b6acf2339201a7464d052f1909b24a64021685b.zip gcc-1b6acf2339201a7464d052f1909b24a64021685b.tar.gz gcc-1b6acf2339201a7464d052f1909b24a64021685b.tar.bz2 |
[AArch64] Fix PR87511
As mentioned in PR87511, the shift used in aarch64_mask_and_shift_for_ubfiz_p
should be evaluated as a HOST_WIDE_INT rather than int.
Passes bootstrap & regress.
gcc/
PR target/87511
* config/aarch64/aarch64.c (aarch64_mask_and_shift_for_ubfiz_p):
Use HOST_WIDE_INT_1U for shift.
testsuite/
PR target/87511
* gcc.target/aarch64/pr87511.c: Add new test.
From-SVN: r265058
Diffstat (limited to 'gcc/config')
-rw-r--r-- | gcc/config/aarch64/aarch64.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/config/aarch64/aarch64.c b/gcc/config/aarch64/aarch64.c index d385b24..4c77908 100644 --- a/gcc/config/aarch64/aarch64.c +++ b/gcc/config/aarch64/aarch64.c @@ -8842,7 +8842,8 @@ aarch64_mask_and_shift_for_ubfiz_p (scalar_int_mode mode, rtx mask, return CONST_INT_P (mask) && CONST_INT_P (shft_amnt) && INTVAL (shft_amnt) < GET_MODE_BITSIZE (mode) && exact_log2 ((INTVAL (mask) >> INTVAL (shft_amnt)) + 1) >= 0 - && (INTVAL (mask) & ((1 << INTVAL (shft_amnt)) - 1)) == 0; + && (INTVAL (mask) + & ((HOST_WIDE_INT_1U << INTVAL (shft_amnt)) - 1)) == 0; } /* Calculate the cost of calculating X, storing it in *COST. Result |