Commit 9d409235 by Jakub Jelinek Committed by Jakub Jelinek

re PR middle-end/90025 (botan2 miscompilation on s390x-linux since r268957)

	PR middle-end/90025
	* expr.c (store_expr): Set properly size on the MEM passed to
	clear_storage.

	* gcc.c-torture/execute/pr90025.c: New test.

From-SVN: r270247
parent c9c5e188
2019-04-10 Jakub Jelinek <jakub@redhat.com> 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 PR c++/90010
* gimple-ssa-sprintf.c (target_to_host): Fix handling of targstr * gimple-ssa-sprintf.c (target_to_host): Fix handling of targstr
with strlen in between hostsz-3 and hostsz-1 inclusive when no with strlen in between hostsz-3 and hostsz-1 inclusive when no
......
...@@ -5658,7 +5658,8 @@ store_expr (tree exp, rtx target, int call_param_p, ...@@ -5658,7 +5658,8 @@ store_expr (tree exp, rtx target, int call_param_p,
dest_mem = store_by_pieces (target, str_copy_len, string_cst_read_str, dest_mem = store_by_pieces (target, str_copy_len, string_cst_read_str,
(void *) str, MEM_ALIGN (target), false, (void *) str, MEM_ALIGN (target), false,
RETURN_END); 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); GEN_INT (exp_len - str_copy_len), BLOCK_OP_NORMAL);
return NULL_RTX; return NULL_RTX;
} }
......
2019-04-10 Jakub Jelinek <jakub@redhat.com> 2019-04-10 Jakub Jelinek <jakub@redhat.com>
PR middle-end/90025
* gcc.c-torture/execute/pr90025.c: New test.
PR c++/90010 PR c++/90010
* gcc.dg/pr90010.c: New test. * gcc.dg/pr90010.c: New test.
......
/* 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment