From patchwork Thu Jul 7 20:44:08 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 103728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5A939B6F74 for ; Fri, 8 Jul 2011 06:44:32 +1000 (EST) Received: (qmail 18004 invoked by alias); 7 Jul 2011 20:44:31 -0000 Received: (qmail 17995 invoked by uid 22791); 7 Jul 2011 20:44:30 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (194.98.77.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 07 Jul 2011 20:44:09 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 2D436CB025F for ; Thu, 7 Jul 2011 22:44:08 +0200 (CEST) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id yTv0rQVMJBUP for ; Thu, 7 Jul 2011 22:43:58 +0200 (CEST) Received: from [192.168.1.2] (bon31-9-83-155-120-49.fbx.proxad.net [83.155.120.49]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mel.act-europe.fr (Postfix) with ESMTP id B337ECB0223 for ; Thu, 7 Jul 2011 22:43:57 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: [SPARC] Fix PR target/49660 Date: Thu, 7 Jul 2011 22:44:08 +0200 User-Agent: KMail/1.9.9 MIME-Version: 1.0 Message-Id: <201107072244.09081.ebotcazou@adacore.com> Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This is the glitch reported by Rainer for the 64-bit compiler on SPARC/Solaris, where we pass -mcpu=v9 in 32-bit mode but this nevertheless doesn't cause the V8+ architecture to be selected, unlike for the 32-bit compiler. Tested on SPARC/Solaris and SPARC64/Solaris, applied on the mainline, and on the 4.6 and 4.5 branches for the second patch. 2011-07-07 Eric Botcazou PR target/49660 * config/sparc/sol2.h [TARGET_64BIT_DEFAULT] (TARGET_DEFAULT): Add MASK_V8PLUS, remove commented out flag and reorder. 2011-07-07 Eric Botcazou 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 * 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-07 Rainer Orth * gcc.target/sparc/cas64.c: New test. Index: config.gcc =================================================================== --- config.gcc (revision 175526) +++ config.gcc (working copy) @@ -2571,7 +2571,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: config/sparc/sol2-64.h =================================================================== --- config/sparc/sol2-64.h (revision 175526) +++ config/sparc/sol2-64.h (working copy) @@ -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 G along with GCC; see the file COPYING3. If not see . */ -#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: config/sparc/sol2.h =================================================================== --- config/sparc/sol2.h (revision 175526) +++ config/sparc/sol2.h (working copy) @@ -153,11 +153,18 @@ along with GCC; see the file COPYING3. #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. */