Commit 46f3e52e by Jakub Jelinek Committed by Jakub Jelinek

re PR target/92904 (varargs for __int128 is placed at an unaligned location and…

re PR target/92904 (varargs for __int128 is placed at an unaligned location and uses movdqa for the load)

	PR target/92904
	* config/i386/i386.c (ix86_gimplify_va_arg): If need_intregs and
	not need_temp, decrease alignment of the read because the GPR save
	area only guarantees 8-byte alignment.

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

From-SVN: r279327
parent 5e4bb241
2019-12-12 Jakub Jelinek <jakub@redhat.com>
PR target/92904
* config/i386/i386.c (ix86_gimplify_va_arg): If need_intregs and
not need_temp, decrease alignment of the read because the GPR save
area only guarantees 8-byte alignment.
2019-12-12 Georg-Johann Lay <avr@gjlay.de> 2019-12-12 Georg-Johann Lay <avr@gjlay.de>
Add support for some more AVR devices from avrxmega3 family. Add support for some more AVR devices from avrxmega3 family.
...@@ -4277,6 +4277,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -4277,6 +4277,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
tree ptrtype; tree ptrtype;
machine_mode nat_mode; machine_mode nat_mode;
unsigned int arg_boundary; unsigned int arg_boundary;
unsigned int type_align;
/* Only 64bit target needs something special. */ /* Only 64bit target needs something special. */
if (is_va_list_char_pointer (TREE_TYPE (valist))) if (is_va_list_char_pointer (TREE_TYPE (valist)))
...@@ -4334,6 +4335,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -4334,6 +4335,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
/* Pull the value out of the saved registers. */ /* Pull the value out of the saved registers. */
addr = create_tmp_var (ptr_type_node, "addr"); addr = create_tmp_var (ptr_type_node, "addr");
type_align = TYPE_ALIGN (type);
if (container) if (container)
{ {
...@@ -4504,6 +4506,9 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -4504,6 +4506,9 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr, t = build2 (PLUS_EXPR, TREE_TYPE (gpr), gpr,
build_int_cst (TREE_TYPE (gpr), needed_intregs * 8)); build_int_cst (TREE_TYPE (gpr), needed_intregs * 8));
gimplify_assign (gpr, t, pre_p); gimplify_assign (gpr, t, pre_p);
/* The GPR save area guarantees only 8-byte alignment. */
if (!need_temp)
type_align = MIN (type_align, 64);
} }
if (needed_sseregs) if (needed_sseregs)
...@@ -4548,6 +4553,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p, ...@@ -4548,6 +4553,7 @@ ix86_gimplify_va_arg (tree valist, tree type, gimple_seq *pre_p,
if (container) if (container)
gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over)); gimple_seq_add_stmt (pre_p, gimple_build_label (lab_over));
type = build_aligned_type (type, type_align);
ptrtype = build_pointer_type_for_mode (type, ptr_mode, true); ptrtype = build_pointer_type_for_mode (type, ptr_mode, true);
addr = fold_convert (ptrtype, addr); addr = fold_convert (ptrtype, addr);
......
2019-12-12 Jakub Jelinek <jakub@redhat.com>
PR target/92904
* gcc.c-torture/execute/pr92904.c: New test.
2019-12-12 Harald Anlauf <anlauf@gmx.de> 2019-12-12 Harald Anlauf <anlauf@gmx.de>
PR fortran/92898 PR fortran/92898
......
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