re PR middle-end/48493 (ice in expand_expr_addr_expr_1 with complex types and mem_ref)
authorRichard Guenther <rguenther@suse.de>
Thu, 31 May 2012 11:06:35 +0000 (11:06 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 31 May 2012 11:06:35 +0000 (11:06 +0000)
2012-05-31  Richard Guenther  <rguenther@suse.de>

PR middle-end/48493
* gcc.dg/torture/pr48493.c: New testcase.

From-SVN: r188058

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr48493.c [new file with mode: 0644]

index 1b5f139..fc10281 100644 (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-31  Greta Yorsh  <Greta.Yorsh@arm.com>
 
        * lib/target-supports.exp (check_effective_target_vect_char_mult): Add
diff --git a/gcc/testsuite/gcc.dg/torture/pr48493.c b/gcc/testsuite/gcc.dg/torture/pr48493.c
new file mode 100644 (file)
index 0000000..ddb61f2
--- /dev/null
@@ -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);
+}