re PR middle-end/48493 (ice in expand_expr_addr_expr_1 with complex types and mem_ref)

2012-05-31  Richard Guenther  <rguenther@suse.de>

	PR middle-end/48493
	* expr.c (expand_assignment): Do not use movmisalign on
	non-memory.

	* gcc.dg/torture/pr48493.c: New testcase.

From-SVN: r188056
This commit is contained in:
Richard Guenther 2012-05-31 11:02:29 +00:00 committed by Richard Biener
parent 5f0b933611
commit f5f1432fc5
4 changed files with 30 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2012-05-31 Richard Guenther <rguenther@suse.de>
PR middle-end/48493
* expr.c (expand_assignment): Do not use movmisalign on
non-memory.
2012-05-30 John David Anglin <dave.anglin@nrc-cnrc.gc.ca>
PR target/52999

View File

@ -4593,6 +4593,7 @@ expand_assignment (tree to, tree from, bool nontemporal)
if ((TREE_CODE (to) == MEM_REF
|| TREE_CODE (to) == TARGET_MEM_REF)
&& mode != BLKmode
&& !mem_ref_refers_to_non_mem_p (to)
&& ((align = get_object_or_type_alignment (to))
< GET_MODE_ALIGNMENT (mode))
&& ((icode = optab_handler (movmisalign_optab, mode))

View File

@ -1,3 +1,8 @@
2012-05-31 Richard Guenther <rguenther@suse.de>
PR middle-end/48493
* gcc.dg/torture/pr48493.c: New testcase.
2012-05-30 Jakub Jelinek <jakub@redhat.com>
PR c++/53356

View File

@ -0,0 +1,18 @@
/* { dg-do compile } */
typedef long long T __attribute__((may_alias, aligned (1)));
struct S
{
_Complex float d __attribute__((aligned (8)));
};
void bar (struct S);
void
f1 (T x)
{
struct S s;
*(T *) ((char *) &s.d + 1) = x;
bar (s);
}