Bootstrapped and tested on x86_64-unknown-linux-gnu, applied.

Richard.

2017-03-09  Richard Biener  <rguent...@suse.de>

        PR ipa/79970
        * ipa-prop.c (ipa_modify_formal_parameters): Avoid changing
        alignment of BLKmode params.

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

Index: gcc/ipa-prop.c
===================================================================
--- gcc/ipa-prop.c      (revision 245987)
+++ gcc/ipa-prop.c      (working copy)
@@ -4198,7 +4198,8 @@
          else
            {
              ptype = adj->type;
-             if (is_gimple_reg_type (ptype))
+             if (is_gimple_reg_type (ptype)
+                 && TYPE_MODE (ptype) != BLKmode)
                {
                  unsigned malign = GET_MODE_ALIGNMENT (TYPE_MODE (ptype));
                  if (TYPE_ALIGN (ptype) != malign)
Index: gcc/testsuite/gcc.dg/torture/pr79970.c
===================================================================
--- gcc/testsuite/gcc.dg/torture/pr79970.c      (revision 0)
+++ gcc/testsuite/gcc.dg/torture/pr79970.c      (working copy)
@@ -0,0 +1,23 @@
+/* { dg-do compile } */
+/* { dg-skip-if "" { *-*-* } { "-flto" } { "" } } */
+/* { dg-additional-options "-mno-sse" { target x86_64-*-* i?86-*-* } } */
+
+typedef int c __attribute__ ((__vector_size__ (16)));
+
+__attribute__((always_inline)) void d (void); /* { dg-warning "" } { dg-error 
7 "inlining failed" } */
+void f(c x);
+
+inline void e (c *b) {
+    f (*b);
+}
+
+void a ()
+{
+  struct
+    {
+      c g[4];
+    } h;
+  d ();
+  e (h.g);
+}
+

Reply via email to