From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ua1-x934.google.com (mail-ua1-x934.google.com [IPv6:2607:f8b0:4864:20::934]) by sourceware.org (Postfix) with ESMTPS id B384A3858D39 for ; Wed, 26 Jan 2022 20:50:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B384A3858D39 Received: by mail-ua1-x934.google.com with SMTP id e17so972436uad.9 for ; Wed, 26 Jan 2022 12:50:46 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JCBGVuW/USZlzsu0rYzB/4eR22/0QnjAhpPTFsjMXwU=; b=kbjWRUDRerQroD+dNRWfW75FdFuCADcQYK5n87YNLqBrUeXr03WOcpH27ZE3jyjGB+ HHZ7ICxK9afyWvYACiDu7gAUhB8bcsmv2hT9Wd6FSooItJYLovhWqA513Xz41KfPNVLW c2+5ObqhV3wvAfJdX6Iydr+60dm+ydACpYTsLQTV+61+ofcgNqRVdnFFDm8QpK8KSEoH XS0dBDfs2F9z6HMB/MPj41HmwtjyeXhoQH2AspWh7982dZZ3YZUmSlnlzlmBeto7NvPN Jr660zZNUzh9xGTivE9D1YWxB8xiierZUyJf+giK4zLY7jBFpQ3TGvspUXqlq/rzctx0 AMdA== X-Gm-Message-State: AOAM5323L0SbKdtYUOnVabVtuoOvc1XcRLcSD/b/QDtBYaYBgSVHlll/ JyhktxfmNdPaa3iywYNKG/+1VpOuyspkFtQ6Ts0= X-Google-Smtp-Source: ABdhPJxCzUvX6qX/qOks52Q894RQwuwqP7+kVwxN9aTI7YHCxhOL8osIeODDachapI9kyveYCaRyiaq//DL63sEuiFk= X-Received: by 2002:a67:e0d9:: with SMTP id m25mr395532vsl.51.1643230246252; Wed, 26 Jan 2022 12:50:46 -0800 (PST) MIME-Version: 1.0 References: <20220126204510.GV2646553@tucnak> In-Reply-To: <20220126204510.GV2646553@tucnak> From: David Edelsohn Date: Wed, 26 Jan 2022 15:50:35 -0500 Message-ID: Subject: Re: [PATCH] rs6000: Fix up #include or [PR104239] To: Jakub Jelinek Cc: Segher Boessenkool , GCC Patches , "Paul A. Clarke" Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, KAM_SHORT, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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, 26 Jan 2022 20:50:48 -0000 On Wed, Jan 26, 2022 at 3:45 PM Jakub Jelinek wrote: > > Hi! > > r12-4717-g7d37abedf58d66 added immintrin.h and x86gprintrin.h headers > to rs6000, these headers are on x86 standalone headers that various > programs include directly rather than including them through > . > Unfortunately, for that change the bmiintrin.h and bmi2intrin.h > headers haven't been adjusted, so the effect is that if one includes them > (without including also x86intrin.h first) #error will trigger. > Furthermore, when including such headers conditionally as some real-world > packages do, this means a regression. > > The following patch fixes it and matches what the x86 bmi{,2}intrin.h > headers do. > > Bootstrapped/regtested on powerpc64le-linux, ok for trunk? Okay. Thanks for catching this. - David > > 2022-01-26 Jakub Jelinek > > PR target/104239 > * config/rs6000/bmiintrin.h: Test _X86GPRINTRIN_H_INCLUDED instead of > _X86INTRIN_H_INCLUDED and adjust #error wording. > * config/rs6000/bmi2intrin.h: Likewise. > > * gcc.target/powerpc/pr104239-1.c: New test. > * gcc.target/powerpc/pr104239-2.c: New test. > > --- gcc/config/rs6000/bmiintrin.h.jj 2022-01-11 23:11:21.936296534 +0100 > +++ gcc/config/rs6000/bmiintrin.h 2022-01-26 13:35:08.705945170 +0100 > @@ -29,8 +29,8 @@ > standard C or GNU C extensions, which are more portable and better > optimized across multiple targets. */ > > -#if !defined _X86INTRIN_H_INCLUDED > -# error "Never use directly; include instead." > +#if !defined _X86GPRINTRIN_H_INCLUDED > +# error "Never use directly; include instead." > #endif > > #ifndef _BMIINTRIN_H_INCLUDED > --- gcc/config/rs6000/bmi2intrin.h.jj 2022-01-11 23:11:21.936296534 +0100 > +++ gcc/config/rs6000/bmi2intrin.h 2022-01-26 13:34:53.373162122 +0100 > @@ -29,8 +29,8 @@ > standard C or GNU C extensions, which are more portable and better > optimized across multiple targets. */ > > -#if !defined _X86INTRIN_H_INCLUDED > -# error "Never use directly; include instead." > +#if !defined _X86GPRINTRIN_H_INCLUDED > +# error "Never use directly; include instead." > #endif > > #ifndef _BMI2INTRIN_H_INCLUDED > --- gcc/testsuite/gcc.target/powerpc/pr104239-1.c.jj 2022-01-26 13:42:34.103643030 +0100 > +++ gcc/testsuite/gcc.target/powerpc/pr104239-1.c 2022-01-26 13:42:23.101798701 +0100 > @@ -0,0 +1,9 @@ > +/* PR target/104239 */ > +/* { dg-do compile } */ > +/* { dg-options "-DNO_WARN_X86_INTRINSICS" } */ > + > +#if __has_include() > +#include > +#endif > + > +int i; > --- gcc/testsuite/gcc.target/powerpc/pr104239-2.c.jj 2022-01-26 13:42:42.279527345 +0100 > +++ gcc/testsuite/gcc.target/powerpc/pr104239-2.c 2022-01-26 13:42:23.101798701 +0100 > @@ -0,0 +1,9 @@ > +/* PR target/104239 */ > +/* { dg-do compile } */ > +/* { dg-options "-DNO_WARN_X86_INTRINSICS" } */ > + > +#if __has_include() > +#include > +#endif > + > +int i; > > Jakub >