From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-qv1-xf31.google.com (mail-qv1-xf31.google.com [IPv6:2607:f8b0:4864:20::f31]) by sourceware.org (Postfix) with ESMTPS id 10247393A41F for ; Wed, 28 Apr 2021 08:24:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 10247393A41F Received: by mail-qv1-xf31.google.com with SMTP id x27so30371200qvd.2 for ; Wed, 28 Apr 2021 01:24:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nRlraS7uLO1VZw36f37gUnZQy0jx3CpJmkjf1LrO+LY=; b=uQUBpxt8alHSa4NNqPbw5oXNXxP0shBvZyYUzroCtDY/yD7Mhqvist+SkmpCsnAa7c dwLPYWVkEg0koTNnpaB+Sf5qF1rv/HqB/9nHsh9avi0+QgVz9IiBWv4TkV0p4xvvVhfK E49LOAYlhFZl6HIWqEO7dN+KfBBY1gGkMbeU+duvbVouwFES8sV53PQXdFtpqiojKRut XDFfcgIGN2AjLObueB2C9Gp47Ji1sbe3HCsLRJ/Yh0i5pGv+Ioh7onpyw3AA1AY6+SYA 1CubPnXgMwRiLjMiH7hU23LnysZfgPNc/MuC1MhJXD1S1lDjwANh7exDybHYWZWQfhwi w1+w== X-Gm-Message-State: AOAM532BjaOOopeo35iZHmGikFarOYMsO6KBTyxrLofGhu+9uFme+6Ru iuVRSa920lx7g+eMuB18KlDyZ+eVXbaOicJvXcw= X-Google-Smtp-Source: ABdhPJwBBJRzk+/UcSZ7VfTV1VVUNGFSbhygxmyDDrEu8UEJlhxvMcjjK76ykLyoHbJKvt+5zOvrLysDAf89u6rQ0j8= X-Received: by 2002:ad4:48c7:: with SMTP id v7mr6119207qvx.24.1619598271580; Wed, 28 Apr 2021 01:24:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Uros Bizjak Date: Wed, 28 Apr 2021 10:24:19 +0200 Message-ID: Subject: Re: add ASM_OUTPUT_MAX_SKIP_ALIGN to i386.h To: Alexandre Oliva Cc: "gcc-patches@gcc.gnu.org" , Jan Hubicka Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-8.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, 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: Wed, 28 Apr 2021 08:24:33 -0000 On Tue, Apr 27, 2021 at 5:34 PM Alexandre Oliva wrote: > > > 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? i386.h is actually the default $tm_file for i386 and x86_64. It is not possible to use x86-64.h without i386.h, so you can simply delete the definition in x86-64.h. Regarding _PAD variant, please remove it and substitute #ifdef ASM_OUTPUT_MAX_SKIP_PAD with #ifdef HAVE_GAS_MAX_SKIP_P2ALIGN. On a related note, while looking at gcc/config.gcc, I noticed that there are two identical code blocks under ${target} i[34567]86-*-* and x86-64-*-*. As much as I have eyeballed the code, I can't find the difference, so perhaps these two blocks should have been merged? Uros. > > 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