From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from rock.gnat.com (rock.gnat.com [205.232.38.15]) by sourceware.org (Postfix) with ESMTP id BEE38398B845 for ; Tue, 27 Apr 2021 15:34:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org BEE38398B845 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=oliva@adacore.com Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 8B40B5606F; Tue, 27 Apr 2021 11:34:12 -0400 (EDT) X-Virus-Scanned: Debian amavisd-new at gnat.com Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id aboxFNzp4m4o; Tue, 27 Apr 2021 11:34:12 -0400 (EDT) Received: from free.home (tron.gnat.com [IPv6:2620:20:4000:0:46a8:42ff:fe0e:e294]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPS id 557CF5606D; Tue, 27 Apr 2021 11:34:12 -0400 (EDT) Received: from livre (livre.home [172.31.160.2]) by free.home (8.15.2/8.15.2) with ESMTPS id 13RFY6qY1575587 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 27 Apr 2021 12:34:06 -0300 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Cc: Jan Hubicka , Uros Bizjak Subject: add ASM_OUTPUT_MAX_SKIP_ALIGN to i386.h Organization: Free thinker, does not speak for AdaCore Errors-To: aoliva@lxoliva.fsfla.org Date: Tue, 27 Apr 2021 12:34:06 -0300 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Scanned-By: MIMEDefang 2.84 X-Spam-Status: No, score=-12.2 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Apr 2021 15:34:15 -0000 Several i386 align tests expect p2align to be used, but not all configurations define ASM_OUTPUT_MAX_SKIP_ALIGN, even when HAVE_GAS_MAX_SKIP_P2ALIGN. i386.h has an equivalent ASM_OUTPUT_MAX_SKIP_PAD that is used in i386.c, so I'm adding an _ALIGN variant, as in x86-64.h, and an #undef to x86-64.h to avoid warnings over the duplicate def; perhaps I should remove them entirely? Should we even keep the x86-specific _PAD? Regstrapped on x86_64-linux-gnu, also tested with a cross to x86-vx7r2. Ok to install? for gcc/ChangeLog * config/i386/i386.h [HAVE_GAS_MAX_SKIP_P2ALIGN] (ASM_OUTPUT_MAX_SKIP_ALIGN): New, copied from... * config/i386/x86-64.h: ... here. Add undef before define. --- gcc/config/i386/i386.h | 10 ++++++++++ gcc/config/i386/x86-64.h | 1 + 2 files changed, 11 insertions(+) diff --git a/gcc/config/i386/i386.h b/gcc/config/i386/i386.h index 96b46bac23858..26b1fda433ea7 100644 --- a/gcc/config/i386/i386.h +++ b/gcc/config/i386/i386.h @@ -2068,6 +2068,16 @@ extern int const svr4_dbx_register_map[FIRST_PSEUDO_REGISTER]; bytes if it is within MAX_SKIP bytes. */ #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +#undef ASM_OUTPUT_MAX_SKIP_ALIGN +#define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ + do { \ + if ((LOG) != 0) { \ + if ((MAX_SKIP) == 0 || (MAX_SKIP) >= (1 << (LOG)) - 1) \ + fprintf ((FILE), "\t.p2align %d\n", (LOG)); \ + else \ + fprintf ((FILE), "\t.p2align %d,,%d\n", (LOG), (MAX_SKIP)); \ + } \ + } while (0) #undef ASM_OUTPUT_MAX_SKIP_PAD #define ASM_OUTPUT_MAX_SKIP_PAD(FILE, LOG, MAX_SKIP) \ if ((LOG) != 0) \ diff --git a/gcc/config/i386/x86-64.h b/gcc/config/i386/x86-64.h index 0cdd980f48105..354bd60005dd1 100644 --- a/gcc/config/i386/x86-64.h +++ b/gcc/config/i386/x86-64.h @@ -75,6 +75,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see #define SUBALIGN_LOG 3 #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN +#undef ASM_OUTPUT_MAX_SKIP_ALIGN #define ASM_OUTPUT_MAX_SKIP_ALIGN(FILE,LOG,MAX_SKIP) \ do { \ if ((LOG) != 0) { \ -- Alexandre Oliva, happy hacker https://FSFLA.org/blogs/lxo/ Free Software Activist GNU Toolchain Engineer Vim, Vi, Voltei pro Emacs -- GNUlius Caesar