2019-04-10 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/90025
+ * expr.c (store_expr): Set properly size on the MEM passed to
+ clear_storage.
+
PR c++/90010
* gimple-ssa-sprintf.c (target_to_host): Fix handling of targstr
with strlen in between hostsz-3 and hostsz-1 inclusive when no
dest_mem = store_by_pieces (target, str_copy_len, string_cst_read_str,
(void *) str, MEM_ALIGN (target), false,
RETURN_END);
- clear_storage (adjust_address (dest_mem, BLKmode, 0),
+ clear_storage (adjust_address_1 (dest_mem, BLKmode, 0, 1, 1, 0,
+ exp_len - str_copy_len),
GEN_INT (exp_len - str_copy_len), BLOCK_OP_NORMAL);
return NULL_RTX;
}
2019-04-10 Jakub Jelinek <jakub@redhat.com>
+ PR middle-end/90025
+ * gcc.c-torture/execute/pr90025.c: New test.
+
PR c++/90010
* gcc.dg/pr90010.c: New test.
--- /dev/null
+/* PR middle-end/90025 */
+
+__attribute__((noipa)) void
+bar (char *p)
+{
+ int i;
+ for (i = 0; i < 6; i++)
+ if (p[i] != "foobar"[i])
+ __builtin_abort ();
+ for (; i < 32; i++)
+ if (p[i] != '\0')
+ __builtin_abort ();
+}
+
+__attribute__((noipa)) void
+foo (unsigned int x)
+{
+ char s[32] = { 'f', 'o', 'o', 'b', 'a', 'r', 0 };
+ ((unsigned int *) s)[2] = __builtin_bswap32 (x);
+ bar (s);
+}
+
+int
+main ()
+{
+ foo (0);
+ return 0;
+}