gcc/
2010-10-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/44948
* config/i386/i386.c (ix86_old_function_arg_boundary): New.
(ix86_function_arg_boundary): Always align parameters on stack
in 64bit and align parameters with alignment >= 16byte on stack
in 32bit. Warn alignment change.
gcc/testsuite/
2010-10-26 H.J. Lu <hongjiu.lu@intel.com>
PR target/44948
* g++.dg/abi/param2.C: Add -Wno-psabi for ilp32 x86.
* g++.dg/vect/pr33860a.cc: Likewise.
* gcc.c-torture/compile/
20070522-1.c: Likewise.
* gcc.dg/compat/struct-align-1_x.c: Likewise.
* gcc.dg/compat/struct-align-1_y.c: Likewise.
* gcc.dg/compat/struct-align-2_x.c: Likewise.
* gcc.dg/compat/struct-align-2_y.c: Likewise.
* gcc.dg/pr44136.c: Likewise.
* gcc.c-torture/compile/pr33617.c: Add -Wno-psabi for x86.
* gcc.dg/compat/vector-1_x.c: Likewise.
* gcc.dg/compat/vector-1_y.c: Likewise.
* gcc.dg/compat/vector-2_x.c: Likewise.
* gcc.dg/compat/vector-2_y.c: Likewise.
* gcc.dg/pr43300.c: Likewise.
* gcc.dg/compat/vector-1a_x.c: Add -Wno-psabi.
* gcc.dg/compat/vector-1a_y.c: Likewise.
* gcc.dg/compat/vector-1b_x.c: Likewise.
* gcc.dg/compat/vector-1b_y.c: Likewise.
* gcc.dg/compat/vector-2a_x.c: Likewise.
* gcc.dg/compat/vector-2a_y.c: Likewise.
* gcc.dg/compat/vector-2b_x.c: Likewise.
* gcc.dg/compat/vector-2b_y.c: Likewise.
* gcc.target/i386/pr39162.c: Likewise.
* gcc.target/i386/pr40906-2.c: Likewise.
* gcc.target/i386/sse-5.c: Likewise.
* gcc.dg/pr35442.c: Prune ABI change warnings.
* gcc.c-torture/execute/pr38151.x: New.
* gcc.target/i386/pr44948-1a.c: Likewise.
* gcc.target/i386/pr44948-1b.c: Likewise.
* gcc.target/i386/pr44948-2a.c: Likewise.
* gcc.target/i386/pr44948-2b.c: Likewise.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@165965
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-10-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44948
+ * config/i386/i386.c (ix86_old_function_arg_boundary): New.
+ (ix86_function_arg_boundary): Always align parameters on stack
+ in 64bit and align parameters with alignment >= 16byte on stack
+ in 32bit. Warn alignment change.
+
2010-10-26 Ian Lance Taylor <iant@google.com>
PR middle-end/45687
return false;
}
-/* Gives the alignment boundary, in bits, of an argument with the
- specified mode and type. */
-
-int
-ix86_function_arg_boundary (enum machine_mode mode, const_tree type)
+static int
+ix86_old_function_arg_boundary (enum machine_mode mode, const_tree type,
+ int align)
{
- int align;
- if (type)
- {
- /* Since the main variant type is used for call, we convert it to
- the main variant type. */
- type = TYPE_MAIN_VARIANT (type);
- align = TYPE_ALIGN (type);
- }
- else
- align = GET_MODE_ALIGNMENT (mode);
- if (align < PARM_BOUNDARY)
- align = PARM_BOUNDARY;
/* In 32bit, only _Decimal128 and __float128 are aligned to their
natural boundaries. */
if (!TARGET_64BIT && mode != TDmode && mode != TFmode)
return align;
}
+/* Gives the alignment boundary, in bits, of an argument with the
+ specified mode and type. */
+
+int
+ix86_function_arg_boundary (enum machine_mode mode, const_tree type)
+{
+ int align;
+ if (type)
+ {
+ /* Since the main variant type is used for call, we convert it to
+ the main variant type. */
+ type = TYPE_MAIN_VARIANT (type);
+ align = TYPE_ALIGN (type);
+ }
+ else
+ align = GET_MODE_ALIGNMENT (mode);
+ if (align < PARM_BOUNDARY)
+ align = PARM_BOUNDARY;
+ else
+ {
+ static bool warned;
+ int saved_align = align;
+
+ if (!TARGET_64BIT && align < 128)
+ align = PARM_BOUNDARY;
+
+ if (warn_psabi
+ && !warned
+ && align != ix86_old_function_arg_boundary (mode, type,
+ saved_align))
+ {
+ warned = true;
+ inform (input_location,
+ "The ABI of passing parameter with %dbyte"
+ " alignment has changed in GCC 4.6",
+ align / BITS_PER_UNIT);
+ }
+ }
+
+ return align;
+}
+
/* Return true if N is a possible register number of function value. */
static bool
+2010-10-26 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR target/44948
+ * g++.dg/abi/param2.C: Add -Wno-psabi for ilp32 x86.
+ * g++.dg/vect/pr33860a.cc: Likewise.
+ * gcc.c-torture/compile/20070522-1.c: Likewise.
+ * gcc.dg/compat/struct-align-1_x.c: Likewise.
+ * gcc.dg/compat/struct-align-1_y.c: Likewise.
+ * gcc.dg/compat/struct-align-2_x.c: Likewise.
+ * gcc.dg/compat/struct-align-2_y.c: Likewise.
+ * gcc.dg/pr44136.c: Likewise.
+
+ * gcc.c-torture/compile/pr33617.c: Add -Wno-psabi for x86.
+ * gcc.dg/compat/vector-1_x.c: Likewise.
+ * gcc.dg/compat/vector-1_y.c: Likewise.
+ * gcc.dg/compat/vector-2_x.c: Likewise.
+ * gcc.dg/compat/vector-2_y.c: Likewise.
+ * gcc.dg/pr43300.c: Likewise.
+
+ * gcc.dg/compat/vector-1a_x.c: Add -Wno-psabi.
+ * gcc.dg/compat/vector-1a_y.c: Likewise.
+ * gcc.dg/compat/vector-1b_x.c: Likewise.
+ * gcc.dg/compat/vector-1b_y.c: Likewise.
+ * gcc.dg/compat/vector-2a_x.c: Likewise.
+ * gcc.dg/compat/vector-2a_y.c: Likewise.
+ * gcc.dg/compat/vector-2b_x.c: Likewise.
+ * gcc.dg/compat/vector-2b_y.c: Likewise.
+ * gcc.target/i386/pr39162.c: Likewise.
+ * gcc.target/i386/pr40906-2.c: Likewise.
+ * gcc.target/i386/sse-5.c: Likewise.
+
+ * gcc.dg/pr35442.c: Prune ABI change warnings.
+
+ * gcc.c-torture/execute/pr38151.x: New.
+ * gcc.target/i386/pr44948-1a.c: Likewise.
+ * gcc.target/i386/pr44948-1b.c: Likewise.
+ * gcc.target/i386/pr44948-2a.c: Likewise.
+ * gcc.target/i386/pr44948-2b.c: Likewise.
+
2010-10-26 Ian Lance Taylor <iant@google.com>
PR middle-end/45687
// PR target/20795
// Test passing aligned empty aggregate
// { dg-do compile }
+// { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } }
struct S { union {} a; } __attribute__((aligned));
/* { dg-do compile } */
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
/* Testcase by Martin Michlmayr <tbm@cyrius.com> */
class Matrix
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
/* This was PR 31606, we were trying to use TImode to expand the
struct copy in SRA but TImode is not support on ia32. */
+/* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
typedef float V8SF __attribute__ ((vector_size (32)));
void bar (V8SF);
void
--- /dev/null
+set additional_flags "-Wno-psabi"
+return 0
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
#include "compat-common.h"
#include "struct-align-1.h"
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
#include "compat-common.h"
#include "struct-align-1.h"
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
/* Disable this test for 16-bit targets. */
#include <limits.h>
+/* { dg-options "-Wno-psabi" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+
/* Disable this test for 16-bit targets. */
#include <limits.h>
/* { dg-options "-w" } */
+/* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
#ifndef SKIP_ATTRIBUTE
/* { dg-options "-w" } */
+/* { dg-options "-w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
#ifndef SKIP_ATTRIBUTE
-/* { dg-options "-w -mno-mmx -msse2" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
#include "vector-1_x.c"
-/* { dg-options "-w -mno-mmx -msse2" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
#include "vector-1_y.c"
-/* { dg-options "-w -mno-mmx -mavx" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
#include "vector-1_x.c"
-/* { dg-options "-w -mno-mmx -mavx" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
#include "vector-1_y.c"
/* { dg-options "-w" } */
-/* { dg-options "-w -mno-mmx" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-w -mno-mmx -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
#ifndef SKIP_ATTRIBUTE
/* { dg-options "-w" } */
-/* { dg-options "-w -mno-mmx" { target { i?86-*-* x86_64-*-* } } } */
+/* { dg-options "-w -mno-mmx -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
#ifndef SKIP_ATTRIBUTE
-/* { dg-options "-w -mno-mmx -msse2" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
#include "vector-2_x.c"
-/* { dg-options "-w -mno-mmx -msse2" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -msse2" } */
#include "vector-2_y.c"
-/* { dg-options "-w -mno-mmx -mavx" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
#include "vector-2_x.c"
-/* { dg-options "-w -mno-mmx -mavx" } */
+/* { dg-options "-w -Wno-psabi -mno-mmx -mavx" } */
#include "vector-2_y.c"
}
/* Ignore a warning that is irrelevant to the purpose of this test. */
-/* { dg-prune-output ".*GCC vector passed by reference.*" } */
+/* { dg-prune-output "(.*GCC vector passed by reference.*|.*ABI of * passing parameter with.*)" } */
/* { dg-do compile } */
/* { dg-options "-Os -w" } */
+/* { dg-options "-Os -w -Wno-psabi" { target { i?86-*-* x86_64-*-* } } } */
+
typedef float V2SF __attribute__ ((vector_size (128)));
V2SF
/* PR debug/44136 */
/* { dg-do compile } */
/* { dg-options "-w -O2 -g" } */
-/* { dg-options "-w -O2 -g -mno-sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
+/* { dg-options "-w -Wno-psabi -O2 -g -mno-sse" { target { { i?86-*-* x86_64-*-* } && ilp32 } } } */
#define vector __attribute((vector_size(16)))
vector float a;
/* { dg-do compile } */
-/* { dg-options "-O2 -msse2 -mno-avx" } */
+/* { dg-options "-O2 -Wno-psabi -msse2 -mno-avx" } */
typedef long long __m256i __attribute__ ((__vector_size__ (32), __may_alias__));
/* { dg-do run } */
/* { dg-require-effective-target ilp32 } */
-/* { dg-options "-O2 -fomit-frame-pointer -fno-asynchronous-unwind-tables -mpush-args -mno-accumulate-outgoing-args -m128bit-long-double" } */
+/* { dg-options "-O2 -Wno-psabi -fomit-frame-pointer -fno-asynchronous-unwind-tables -mpush-args -mno-accumulate-outgoing-args -m128bit-long-double" } */
void abort (void);
--- /dev/null
+/* PR target/44948 */
+/* { dg-do run } */
+/* { dg-options "-O -Wno-psabi -mtune=generic" } */
+/* { dg-require-effective-target avx_runtime } */
+/* { dg-additional-sources pr44948-1b.c } */
+
+#pragma GCC target ("avx")
+
+struct A { long b[8] __attribute__((aligned (32))); };
+void foo (long double, struct A);
+
+int
+main (void)
+{
+ struct A a = { { 0, 1, 2, 3, 4, 5, 6, 7 } };
+ foo (8.0L, a);
+ return 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -mno-avx -Wno-psabi -mtune=generic" } */
+
+struct A { long b[8] __attribute__((aligned (32))); };
+
+void
+foo (long double x, struct A y)
+{
+ int i;
+ if (x != 8.0L)
+ __builtin_abort ();
+ for (i = 0; i < 8; i++)
+ if (y.b[i] != i)
+ __builtin_abort ();
+}
--- /dev/null
+/* PR target/44948 */
+/* { dg-do run } */
+/* { dg-options "-O -Wno-psabi -mno-sse -mtune=generic" } */
+/* { dg-require-effective-target ilp32 } */
+/* { dg-require-effective-target sse2_runtime } */
+/* { dg-additional-sources pr44948-2b.c } */
+
+#pragma GCC target ("sse2")
+
+struct A
+{
+ float V4SF __attribute__ ((vector_size (16)));
+};
+
+int
+main (void)
+{
+ struct A a = { { 0, 1, 2, 3 } };
+ foo (8.0L, a, 8.0L);
+ return 0;
+}
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O -mno-sse -Wno-psabi -mtune=generic" } */
+
+struct A
+{
+ float V4SF __attribute__ ((vector_size (16)));
+};
+
+void
+foo (long double x, struct A y, long double z)
+{
+ int i;
+ struct A a = { { 0, 1, 2, 3 } };
+
+ if (x != 8.0L || z != 8.0L)
+ __builtin_abort ();
+ if (__builtin_memcmp (&a, &y, sizeof (a)))
+ __builtin_abort ();
+}
/* { dg-do compile } */
/* { dg-require-effective-target ilp32 } */
/* { dg-skip-if "" { i?86-*-* x86_64-*-* } { "-march=*" } { "-march=i386" } } */
-/* { dg-options "-Winline -O2 -march=i386" } */
+/* { dg-options "-Winline -Wno-psabi -O2 -march=i386" } */
typedef double v2df __attribute__ ((vector_size (16)));
v2df p;