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
+2018-10-11 Wilco Dijkstra <wdijkstr@arm.com>
+
+ PR target/87511
+ * config/aarch64/aarch64.c (aarch64_mask_and_shift_for_ubfiz_p):
+ Use HOST_WIDE_INT_1U for shift.
+
2018-10-11 Doug Rupp <rupp@adacore.com>
Olivier Hainque <hainque@adacore.com>
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
+2018-10-11 Wilco Dijkstra <wdijkstr@arm.com>
+
+ PR target/87511
+ * gcc.target/aarch64/pr87511.c: Add new test.
+
2018-10-11 David Malcolm <dmalcolm@redhat.com>
PR c++/84993
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options "-Os" } */
+
+int a, d;
+struct {
+ signed f5 : 26;
+ signed f6 : 12;
+} b;
+signed char c;
+void fn1() {
+ signed char *e = &c;
+ d = a * 10;
+ *e = d;
+ b.f6 = c;
+ b.f5 = 8 <= 3;
+}