]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Warn passing SSE argument ABI change for -m64
authorH.J. Lu <hongjiu.lu@intel.com>
Mon, 21 May 2012 12:48:38 +0000 (12:48 +0000)
committerH.J. Lu <hjl@gcc.gnu.org>
Mon, 21 May 2012 12:48:38 +0000 (05:48 -0700)
gcc/

PR target/53425
* config/i386/i386.c (type_natural_mode): Warn passing SSE
vector argument without SSE enabled changes the ABI.

gcc/testsuite/

PR target/53425
* gcc.target/i386/pr53425-1.c: New file.
* gcc.target/i386/pr53425-2.c: Likewise.

From-SVN: r187711

gcc/ChangeLog
gcc/config/i386/i386.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/i386/pr53425-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr53425-2.c [new file with mode: 0644]

index 75190eb106ef5cfdc8f7fa06508e05ff4b9df207..d6eb3d1b8abce46f27807a699d6cf91d747735dd 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/53425
+       * config/i386/i386.c (type_natural_mode): Warn passing SSE
+       vector argument without SSE enabled changes the ABI.
+
 2012-05-21  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53408
index eca542c7a19bca2daf5d8de3bc3a27676860d149..4b27cdf28a295c105abae85348511aa14884d293 100644 (file)
@@ -5827,6 +5827,20 @@ type_natural_mode (const_tree type, const CUMULATIVE_ARGS *cum)
                      }
                    return TYPE_MODE (type);
                  }
+               else if ((size == 8 || size == 16) && !TARGET_SSE)
+                 {
+                   static bool warnedsse;
+
+                   if (cum
+                       && !warnedsse
+                       && cum->warn_sse)
+                     {
+                       warnedsse = true;
+                       warning (0, "SSE vector argument without SSE "
+                                "enabled changes the ABI");
+                     }
+                   return mode;
+                 }
                else
                  return mode;
              }
index 585ee31ff9357104f158b26674ffccd6f4f8e584..63667c0fb4ebd85a63b90d77c0efbf78c7d18602 100644 (file)
@@ -1,3 +1,9 @@
+2012-05-21  H.J. Lu  <hongjiu.lu@intel.com>
+
+       PR target/53425
+       * gcc.target/i386/pr53425-1.c: New file.
+       * gcc.target/i386/pr53425-2.c: Likewise.
+
 2012-05-21  Richard Guenther  <rguenther@suse.de>
 
        PR tree-optimization/53408
diff --git a/gcc/testsuite/gcc.target/i386/pr53425-1.c b/gcc/testsuite/gcc.target/i386/pr53425-1.c
new file mode 100644 (file)
index 0000000..2446c0f
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/53425 */
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mno-sse" } */
+
+typedef double __v2df __attribute__ ((__vector_size__ (16)));
+
+extern __v2df x;
+
+extern void bar (__v2df);
+void
+foo (void)
+{
+  bar (x); /* { dg-message "warning: SSE vector argument without SSE enabled changes the ABI" } */
+}
diff --git a/gcc/testsuite/gcc.target/i386/pr53425-2.c b/gcc/testsuite/gcc.target/i386/pr53425-2.c
new file mode 100644 (file)
index 0000000..b89a5b1
--- /dev/null
@@ -0,0 +1,14 @@
+/* PR target/53425 */
+/* { dg-do compile { target { ! { ia32 } } } } */
+/* { dg-options "-O2 -mno-sse" } */
+
+typedef float __v2sf __attribute__ ((__vector_size__ (8)));
+
+extern __v2sf x;
+
+extern void bar (__v2sf);
+void
+foo (void)
+{
+  bar (x); /* { dg-message "warning: SSE vector argument without SSE enabled changes the ABI" } */
+}