Commit 6cd7942d by H.J. Lu Committed by H.J. Lu

re PR middle-end/36701 (unaligned access in gcc.c-torture/execute/complex-7.c)

2008-08-13  H.J. Lu  <hongjiu.lu@intel.com>

	PR middle-end/36701
	* expr.c (emit_group_store): Allocate stack temp with the
	largest alignment when copying from register to stack.

From-SVN: r139062
parent 99f536cc
2008-08-13 H.J. Lu <hongjiu.lu@intel.com>
PR middle-end/36701
* expr.c (emit_group_store): Allocate stack temp with the
largest alignment when copying from register to stack.
2008-08-13 Richard Guenther <rguenther@suse.de> 2008-08-13 Richard Guenther <rguenther@suse.de>
* tree.h (maybe_fold_offset_to_address): Declare. * tree.h (maybe_fold_offset_to_address): Declare.
......
...@@ -2074,12 +2074,31 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize) ...@@ -2074,12 +2074,31 @@ emit_group_store (rtx orig_dst, rtx src, tree type ATTRIBUTE_UNUSED, int ssize)
} }
else else
{ {
gcc_assert (bytepos == 0 && XVECLEN (src, 0)); enum machine_mode dest_mode = GET_MODE (dest);
dest = assign_stack_temp (GET_MODE (dest), enum machine_mode tmp_mode = GET_MODE (tmps[i]);
GET_MODE_SIZE (GET_MODE (dest)), 0); int dest_size = GET_MODE_SIZE (dest_mode);
emit_move_insn (adjust_address (dest, GET_MODE (tmps[i]), bytepos), int tmp_size = GET_MODE_SIZE (tmp_mode);
tmps[i]);
dst = dest; gcc_assert (bytepos == 0
&& XVECLEN (src, 0)
&& dest_size == tmp_size);
if (GET_MODE_ALIGNMENT (dest_mode)
>= GET_MODE_ALIGNMENT (tmp_mode))
{
dest = assign_stack_temp (dest_mode, dest_size, 0);
emit_move_insn (adjust_address (dest,
tmp_mode,
bytepos),
tmps[i]);
dst = dest;
}
else
{
dest = assign_stack_temp (tmp_mode, tmp_size, 0);
emit_move_insn (dest, tmps[i]);
dst = adjust_address (dest, dest_mode, bytepos);
}
break; break;
} }
} }
......
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