]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR target/49660 (64-bit gcc doesn't enable -mv8plus with -m32 on Solaris/SPARC)
authorEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 7 Jul 2011 20:43:43 +0000 (20:43 +0000)
committerEric Botcazou <ebotcazou@gcc.gnu.org>
Thu, 7 Jul 2011 20:43:43 +0000 (20:43 +0000)
PR target/49660
* config/sparc/sol2.h [TARGET_64BIT_DEFAULT] (TARGET_DEFAULT): Add
MASK_V8PLUS, remove commented out flag and reorder.

Backport from mainline
2011-06-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

* config/sparc/sol2-64.h (TARGET_DEFAULT): Remove.
(TARGET_64BIT_DEFAULT): Define.
* config.gcc (sparc*-*-solaris2*): Move sparc/sol2-64.h to front
of tm_file.
* config/sparc/sol2.h [TARGET_64BIT_DEFAULT] (TARGET_DEFAULT): Define.

From-SVN: r176010

gcc/ChangeLog
gcc/config.gcc
gcc/config/sparc/sol2-64.h
gcc/config/sparc/sol2.h
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/sparc/cas64.c [new file with mode: 0644]

index 48b42087e22366d5698a4644ed3157cbbb09ec91..85e33be553efa9cea1dcc896509b5cdde7e66d0f 100644 (file)
@@ -1,3 +1,18 @@
+2011-07-07  Eric Botcazou  <ebotcazou@adacore.com>
+
+       PR target/49660
+       * config/sparc/sol2.h [TARGET_64BIT_DEFAULT] (TARGET_DEFAULT): Add
+       MASK_V8PLUS, remove commented out flag and reorder.
+
+       Backport from mainline
+       2011-06-28  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * config/sparc/sol2-64.h (TARGET_DEFAULT): Remove.
+       (TARGET_64BIT_DEFAULT): Define.
+       * config.gcc (sparc*-*-solaris2*): Move sparc/sol2-64.h to front
+       of tm_file.
+       * config/sparc/sol2.h [TARGET_64BIT_DEFAULT] (TARGET_DEFAULT): Define.
+
 2011-07-04  Richard Guenther  <rguenther@suse.de>
 
        Backport from mainline
index 0ff189c33908cacd7e92eb61c904df1f4058cb7d..372d8befc8d2258e82e9a599444f44c51fe5e08e 100644 (file)
@@ -2422,7 +2422,7 @@ sparc*-*-solaris2*)
        tm_file="${tm_file} sparc/sol2.h"
        case ${target} in
            sparc64-*-* | sparcv9-*-*)
-               tm_file="${tm_file} sparc/sol2-64.h"
+               tm_file="sparc/sol2-64.h ${tm_file}"
                ;;
            *)
                test x$with_cpu != x || with_cpu=v9
index cf0bbff1ec6b822283c1585ff69722c7b7b4e137..41e228114a6556e5dc6ebfc6a1a4f40b2dd8f4c6 100644 (file)
@@ -1,7 +1,7 @@
 /* Definitions of target machine for GCC, for bi-arch SPARC
    running Solaris 2, defaulting to 64-bit code generation.
 
-   Copyright (C) 1999, 2010 Free Software Foundation, Inc.
+   Copyright (C) 1999, 2010, 2011 Free Software Foundation, Inc.
 
 This file is part of GCC.
 
@@ -19,7 +19,4 @@ You should have received a copy of the GNU General Public License
 along with GCC; see the file COPYING3.  If not see
 <http://www.gnu.org/licenses/>.  */
 
-#undef TARGET_DEFAULT
-#define TARGET_DEFAULT \
-  (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ + \
-   MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
+#define TARGET_64BIT_DEFAULT 1
index 4523f8c3ed6e422971e75dc866a9d1e0e2ee744a..220f576eb2101fd2ab86a283332d4afc9302d7b6 100644 (file)
@@ -153,11 +153,18 @@ along with GCC; see the file COPYING3.  If not see
 #undef SUN_INTEGER_MULTIPLY_64
 #define SUN_INTEGER_MULTIPLY_64 1
 
-/* Solaris allows 64 bit out and global registers in 32 bit mode.
-   sparc_override_options will disable V8+ if not generating V9 code.  */
+/* Solaris allows 64-bit out and global registers to be used in 32-bit mode.
+   sparc_override_options will disable V8+ if either not generating V9 code
+   or generating 64-bit code.  */
 #undef TARGET_DEFAULT
-#define TARGET_DEFAULT (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU \
-                       + MASK_LONG_DOUBLE_128)
+#ifdef TARGET_64BIT_DEFAULT
+#define TARGET_DEFAULT \
+  (MASK_V9 + MASK_64BIT + MASK_PTR64 + MASK_STACK_BIAS + \
+   MASK_V8PLUS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
+#else
+#define TARGET_DEFAULT \
+  (MASK_V8PLUS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
+#endif
 
 /* Solaris-specific #pragmas are implemented on top of attributes.  Hook in
    the bits from config/sol2.c.  */
index ffe02596b6c4db211be3aa4eb158c354e1eac67d..4fdd94056b995a9102068417a55cee7a44b752b0 100644 (file)
@@ -1,3 +1,7 @@
+2011-07-07  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
+
+       * gcc.target/sparc/cas64.c: New test.
+
 2011-07-05  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
        * ada/acats/run_acats (which): Extract last field from type -p,
diff --git a/gcc/testsuite/gcc.target/sparc/cas64.c b/gcc/testsuite/gcc.target/sparc/cas64.c
new file mode 100644 (file)
index 0000000..ed27cd7
--- /dev/null
@@ -0,0 +1,15 @@
+/* PR target/49660 */
+
+/* { dg-do compile { target sparc*-*-solaris2.* } } */
+
+#include <stdint.h>
+
+extern int64_t *val, old, new;
+
+int
+cas64 (void)
+{
+  return __sync_bool_compare_and_swap (val, old, new);
+}
+
+/* { dg-final { scan-assembler-not "compare_and_swap_8" } } */