From: H.J. Lu Date: Mon, 21 May 2012 12:48:38 +0000 (+0000) Subject: Warn passing SSE argument ABI change for -m64 X-Git-Tag: misc/gccgo-go1_1_2~2794 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=30ee9dbf3d7636fb6b590ea3a1cbf56900b1e9c0;p=thirdparty%2Fgcc.git Warn passing SSE argument ABI change for -m64 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 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 75190eb106ef..d6eb3d1b8abc 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2012-05-21 H.J. Lu + + 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 PR tree-optimization/53408 diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index eca542c7a19b..4b27cdf28a29 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -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; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 585ee31ff935..63667c0fb4eb 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2012-05-21 H.J. Lu + + PR target/53425 + * gcc.target/i386/pr53425-1.c: New file. + * gcc.target/i386/pr53425-2.c: Likewise. + 2012-05-21 Richard Guenther 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 index 000000000000..2446c0f54196 --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr53425-1.c @@ -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 index 000000000000..b89a5b1fa8cd --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr53425-2.c @@ -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" } */ +}