]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR middle-end/17930 (-mfpmath=sse creates illegal code (movapd with misaligned...
authorRichard Henderson <rth@redhat.com>
Tue, 14 Dec 2004 01:24:36 +0000 (17:24 -0800)
committerRichard Henderson <rth@gcc.gnu.org>
Tue, 14 Dec 2004 01:24:36 +0000 (17:24 -0800)
        PR middle-end/17930
        * toplev.c (rest_of_compilation): Fix computation of
        preferred_incoming_stack_boundary.

From-SVN: r92115

gcc/ChangeLog
gcc/testsuite/gcc.dg/i386-sse-10.c [new file with mode: 0644]
gcc/toplev.c

index 581e58e674eb9301e21bf58d75df0112eff9f505..473ea11cf4326035416a5f122347b06c3869afd3 100644 (file)
@@ -1,3 +1,9 @@
+2004-12-13  Richard Henderson  <rth@redhat.com>
+
+       PR middle-end/17930
+       * toplev.c (rest_of_compilation): Fix computation of
+       preferred_incoming_stack_boundary.
+
 2004-12-12  Richard Henderson  <rth@redhat.com>
 
         PR rtl-opt/17186
diff --git a/gcc/testsuite/gcc.dg/i386-sse-10.c b/gcc/testsuite/gcc.dg/i386-sse-10.c
new file mode 100644 (file)
index 0000000..ae557f3
--- /dev/null
@@ -0,0 +1,34 @@
+/* PR 17930 */
+/* { dg-do run { target i?86-*-* x86_64-*-* } } */
+/* { dg-options "-O1 -msse2 -mfpmode=sse -mno-accumulate-outgoing-args" } */
+
+#include "i386-cpuid.h"
+
+typedef _Complex double complex_16;
+
+void NOINLINE
+test (complex_16 a[5][5])
+{
+  int i, j, k;
+  complex_16 x;
+
+  for (j = 0; j < 5; j++)
+    for (i = 0; i < 5; i++)
+      {
+        for (k = 0; k < j - 1; ++k)
+         x = a[k][i] * ~a[k][j];
+       a[j][i] = x;
+      }
+}
+
+int main()
+{
+  static complex_16 work[5][5];
+  unsigned long cpu_facilities;
+
+  cpu_facilities = i386_cpuid ();
+  if (cpu_facilities & bit_SSE2)
+    test (work); 
+
+  return 0;
+}
index 4e7a73a205f0966a2c0337d3da7b47a85d948054..655406d793993d14ea33d0396c8012fce343c60c 100644 (file)
@@ -3656,8 +3656,7 @@ rest_of_compilation (tree decl)
   if ((*targetm.binds_local_p) (current_function_decl))
     {
       int pref = cfun->preferred_stack_boundary;
-      if (cfun->recursive_call_emit
-          && cfun->stack_alignment_needed > cfun->preferred_stack_boundary)
+      if (cfun->stack_alignment_needed > cfun->preferred_stack_boundary)
        pref = cfun->stack_alignment_needed;
       cgraph_rtl_info (current_function_decl)->preferred_incoming_stack_boundary
         = pref;