Backported from mainline
2019-02-05 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/89195
+ * combine.c (make_extraction): For MEMs, don't extract bytes outside
+ of the original MEM.
+
PR target/89186
* optabs.c (prepare_cmp_insn): Pass x and y to
emit_block_comp_via_libcall rather than XEXP (x, 0) and XEXP (y, 0).
/* We can't do this if we are widening INNER_MODE (it
may not be aligned, for one thing). */
&& GET_MODE_PRECISION (inner_mode) >= GET_MODE_PRECISION (tmode)
+ && pos + len <= GET_MODE_PRECISION (is_mode)
&& (inner_mode == tmode
|| (! mode_dependent_address_p (XEXP (inner, 0),
MEM_ADDR_SPACE (inner))
Backported from mainline
2019-02-05 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/89195
+ * gcc.c-torture/execute/pr89195.c: New test.
+
PR target/89186
* g++.dg/ext/vector36.C: New test.
--- /dev/null
+/* PR rtl-optimization/89195 */
+/* { dg-require-effective-target int32plus } */
+
+struct S { unsigned i : 24; };
+
+volatile unsigned char x;
+
+__attribute__((noipa)) int
+foo (struct S d)
+{
+ return d.i & x;
+}
+
+int
+main ()
+{
+ struct S d = { 0x123456 };
+ x = 0x75;
+ if (foo (d) != (0x56 & 0x75))
+ __builtin_abort ();
+ return 0;
+}