re PR ipa/79970 (ICE in add_stack_var, at cfgexpand.c:450 with always_inline attribute)
authorRichard Biener <rguenther@suse.de>
Thu, 9 Mar 2017 13:20:03 +0000 (13:20 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Thu, 9 Mar 2017 13:20:03 +0000 (13:20 +0000)
2017-03-09  Richard Biener  <rguenther@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.

From-SVN: r246001

gcc/ChangeLog
gcc/ipa-prop.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/torture/pr79970.c [new file with mode: 0644]

index a50c7e97e0b63697fb5ed981d29af6c92f5a3101..da50ae6cd43d468bf62c87b06a9000f8e27696df 100644 (file)
@@ -1,3 +1,9 @@
+2017-03-09  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/79970
+       * ipa-prop.c (ipa_modify_formal_parameters): Avoid changing
+       alignment of BLKmode params.
+
 2017-03-09  Kyrylo Tkachov  <kyrylo.tkachov@arm.com>
 
        PR target/79913
index d519cdfcbabae3578ffa62caf870941a6be47fef..b3d51595d3fa6867eabe669238627f06f6756617 100644 (file)
@@ -4198,7 +4198,8 @@ ipa_modify_formal_parameters (tree fndecl, ipa_parm_adjustment_vec adjustments)
          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 98f8733110b3809426f04b6ff1c7d4875d4d5402..78f68314db1a416dc747fe87967a0373719c0c27 100644 (file)
@@ -1,3 +1,8 @@
+2017-03-09  Richard Biener  <rguenther@suse.de>
+
+       PR ipa/79970
+       * gcc.dg/torture/pr79970.c: New testcase.
+
 2017-03-09  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/71966
diff --git a/gcc/testsuite/gcc.dg/torture/pr79970.c b/gcc/testsuite/gcc.dg/torture/pr79970.c
new file mode 100644 (file)
index 0000000..270d5d7
--- /dev/null
@@ -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);
+}
+