From patchwork Tue Feb 12 12:53:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rainer Orth X-Patchwork-Id: 1040552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-495942-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=CeBiTec.Uni-Bielefeld.DE Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="sZno5SBU"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43zMzr5V5Xz9s4Z for ; Tue, 12 Feb 2019 23:54:16 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; q=dns; s=default; b=YgGMa2SzboRsjA3w+s3Z4cVDSmwhg33LZ6DGz/tuEa/dG9If5Z vszgqgqgv55kezTk0VZJLacmQf7Cti6Nv0JY58FZeZtLWi0714s54cf/qjWt2SdF 5spB/Y7biPj2P24Gkwb76RTG0B7OvZ8A7vcJV2QmlOvM2jnGJYH9x4904= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id:mime-version:content-type; s= default; bh=HpHlFl0qxXkPGryltqQk+Uuf3xw=; b=sZno5SBUAxHx/nGDJmQ/ BZUriOdEJQfl2lM34jIr8VxNwKziWJQSZRRUjxKjDK7STSRst+PfjQTqwRx9SeFN yakQpJzfNajhCcoxckPGlCjZYc+eGgyUzaeXsKYCD7pcFTS+l0W5rrFow+eoGHX6 8c6Ovl1IfdpMFNfyT3eZqS8= Received: (qmail 40748 invoked by alias); 12 Feb 2019 12:54:09 -0000 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 Received: (qmail 40595 invoked by uid 89); 12 Feb 2019 12:54:09 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-20.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, KAM_NUMSUBJECT autolearn=ham version=3.3.2 spammy= X-HELO: smtp.CeBiTec.Uni-Bielefeld.DE Received: from smtp.CeBiTec.Uni-Bielefeld.DE (HELO smtp.CeBiTec.Uni-Bielefeld.DE) (129.70.160.84) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Feb 2019 12:54:07 +0000 Received: from localhost (localhost.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTP id 01AF05B4; Tue, 12 Feb 2019 13:54:04 +0100 (CET) Received: from smtp.CeBiTec.Uni-Bielefeld.DE ([127.0.0.1]) by localhost (malfoy.CeBiTec.Uni-Bielefeld.DE [127.0.0.1]) (amavisd-new, port 10024) with LMTP id FtMeyz9ZABsg; Tue, 12 Feb 2019 13:54:01 +0100 (CET) Received: from lokon.CeBiTec.Uni-Bielefeld.DE (lokon.CeBiTec.Uni-Bielefeld.DE [129.70.161.152]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.CeBiTec.Uni-Bielefeld.DE (Postfix) with ESMTPS id 379075B3; Tue, 12 Feb 2019 13:54:01 +0100 (CET) Received: (from ro@localhost) by lokon.CeBiTec.Uni-Bielefeld.DE (8.15.2+Sun/8.15.2/Submit) id x1CCrxVf006483; Tue, 12 Feb 2019 13:53:59 +0100 (MET) From: Rainer Orth To: gcc-patches@gcc.gnu.org Cc: Eric Botcazou Subject: Define __sparcv8 in 64-bit-default Solaris/SPARC gcc with -m32 Date: Tue, 12 Feb 2019 13:53:59 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (usg-unix-v) MIME-Version: 1.0 X-IsSubscribed: yes I noticed that a 64-bit-default Solaris/SPARC gcc with -m32 doesn't predefine __sparcv8, unlike the corresponding 32-bit-default compiler. Since those defines happen in CPP_CPU_SPEC for any explicit -mcpu option of v8, supersparc, v9 and beyond, this must be due to -mcpu being set in the driver of the 32-bit compiler, but not in the 64-bit one. Indeed, I find -mcpu=v9 in COLLECT_GCC_OPTIONS of the 32-bit compiler, but only -m32 for the 64-bit one. AFAICS this happens due to OPTION_DEFAULT_SPECS: it includes {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ for 32-bit-default and for 64-bit-default: {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ Without an explicit --with-cpu configure option, config.gcc sets with_cpu=v9 for both 32 and 64-bit sparc compilers. For the sparcv9 gcc with -m32 however, the passing of -mcpu=v9 is suppressed by the second spec above. In line with the handling of --with-tune/-mtune below, -mcpu should be the same when no explicit -mcpu is given, irrespective of -m32 or -m64. The following patch just removes those guards. Bootstrapped without regressions on sparcv9-sun-solaris2.11 and sparc-sun-solaris2.11. Besides, I've compared the output of gcc -m32/-m64 -g3 -E -x c /dev/null Before the patch, -D__sparcv8 was missing in the sparcv9 gcc's -m32 case, now -m32 and -m64 output is identical between sparc and sparcv9 compilers. Eric, could you have another look if I'm missing something? Otherwise, I'm going to commit the patch (it's necessary to enable SANITIZER_CAN_FAST_UNWIND on Solaris/SPARC and make use of libsanitizer/sanitizer_common/sanitizer_stacktrace_sparc.cc). Rainer # HG changeset patch # Parent c72a287bd21743e4d6759e58a6adc3ad5e30d52c Define __sparcv8 in 64-bit-default Solaris/SPARC gcc with -m32 diff --git a/gcc/config/sparc/sol2.h b/gcc/config/sparc/sol2.h --- a/gcc/config/sparc/sol2.h +++ b/gcc/config/sparc/sol2.h @@ -273,7 +273,7 @@ extern const char *host_detect_local_cpu #define OPTION_DEFAULT_SPECS \ {"cpu_32", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"cpu_64", "%{m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ - {"cpu", "%{!m64:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ + {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \ {"tune_32", "%{!m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"tune_64", "%{m64:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \ @@ -282,7 +282,7 @@ extern const char *host_detect_local_cpu #define OPTION_DEFAULT_SPECS \ {"cpu_32", "%{m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ {"cpu_64", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ - {"cpu", "%{!m32:%{!mcpu=*:-mcpu=%(VALUE)}}" }, \ + {"cpu", "%{!mcpu=*:-mcpu=%(VALUE)}" }, \ {"tune_32", "%{m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"tune_64", "%{!m32:%{!mtune=*:-mtune=%(VALUE)}}" }, \ {"tune", "%{!mtune=*:-mtune=%(VALUE)}" }, \