From bce08d5003e0cb1f63cbe92895be8cbcc5c48547 Mon Sep 17 00:00:00 2001 From: "H.J. Lu" Date: Wed, 18 Feb 2009 02:16:03 +0000 Subject: re PR target/39082 (union with long double doesn't follow x86-64 psABI) gcc/ 2009-02-17 H.J. Lu PR target/39082 * c.opt (Wabi): Support C and ObjC. (Wpsabi): New. * c-opts.c (c_common_handle_option): Handle OPT_Wabi. * config/i386/i386.c (classify_argument): Warn once about the ABI change when passing union with long double. * doc/invoke.texi: Update -Wabi for warning psABI changes. gcc/testsuite/ 2009-02-17 H.J. Lu PR target/39082 * g++.dg/compat/struct-layout-1_generate.c (dg_options): Add -Wno-abi for x86. * gcc.dg/compat/struct-layout-1_generate.c (dg_options): Likewise. * gcc.target/i386/pr39082-1.c: New. * gcc.target/x86_64/abi/abi-x86_64.exp (additional_flags): Add -Wno-abi. * gcc.target/x86_64/abi/args.h (XMM_T): Add _m64 and _m128 if CHECK_M64_M128 is defined. (check_f_arguments): Add "do". (check_vector_arguments): New. (check_m64_arguments): Likewise. (check_m128_arguments): Likewise. * gcc.target/x86_64/abi/defines.h: Include . (CHECK_M64_M128): Define. * gcc.target/x86_64/abi/test_m64m128_returning.c: New. Based on abitest. * gcc.target/x86_64/abi/test_passing_m64m128.c: Likewise. * gcc.target/x86_64/abi/test_passing_structs.c: Define __m128 tests only if CHECK_M64_M128 is defined. * gcc.target/x86_64/abi/test_passing_structs.c (m128_struct): New. (m128_2_struct): Likewise. (check_struct_passing5): Likewise. (check_struct_passing6): Likewise. (main): Test struct with __m128 if CHECK_M64_M128 is defined. * gcc.target/x86_64/abi/test_passing_unions.c (un4): New. (un5): Likewise. (check_union_passing4): Likewise. (main): Test union with __m128 if CHECK_M64_M128 is defined. From-SVN: r144257 --- gcc/doc/invoke.texi | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) (limited to 'gcc/doc') diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 6d36794..f52b643 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -1966,7 +1966,7 @@ Do not assume @samp{inline} for functions defined inside a class scope. functions will have linkage like inline functions; they just won't be inlined by default. -@item -Wabi @r{(C++ and Objective-C++ only)} +@item -Wabi @r{(C, Objective-C, C++ and Objective-C++ only)} @opindex Wabi @opindex Wno-abi Warn when G++ generates code that is probably not compatible with the @@ -2066,6 +2066,27 @@ Instantiations of these templates may be mangled incorrectly. @end itemize +It also warns psABI related changes. The known psABI changes at this +point include: + +@itemize @bullet + +@item +For SYSV/x86-64, when passing union with long double, it is changed to +pass in memory as specified in psABI. For example: + +@smallexample +union U @{ + long double ld; + int i; +@}; +@end smallexample + +@noindent +@code{union U} will always be passed in memory. + +@end itemize + @item -Wctor-dtor-privacy @r{(C++ and Objective-C++ only)} @opindex Wctor-dtor-privacy @opindex Wno-ctor-dtor-privacy -- cgit v1.1