public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
@ 2022-01-26 12:40 jakub at gcc dot gnu.org
  2022-01-26 12:40 ` [Bug target/104239] " jakub at gcc dot gnu.org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-26 12:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

            Bug ID: 104239
           Summary: [12 Regression] immintrin.h or x86gprintrin.h headers
                    can't be included
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
  Target Milestone: ---

Code like:
#if __has_include(<immintrin.h>)
#include <immintrin.h>
#endif
regressed in GCC 12 on powerpc*,
# error "Never use <bmiintrin.h> directly; include <x86intrin.h> instead."

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
@ 2022-01-26 12:40 ` jakub at gcc dot gnu.org
  2022-01-26 12:45 ` jakub at gcc dot gnu.org
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-26 12:40 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2022-01-26
   Target Milestone|---                         |12.0
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
           Priority|P3                          |P1

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
  2022-01-26 12:40 ` [Bug target/104239] " jakub at gcc dot gnu.org
@ 2022-01-26 12:45 ` jakub at gcc dot gnu.org
  2022-01-26 20:48 ` glisse at gcc dot gnu.org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-26 12:45 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Created attachment 52291
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52291&action=edit
gcc12-pr104239.patch

Untested fix.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
  2022-01-26 12:40 ` [Bug target/104239] " jakub at gcc dot gnu.org
  2022-01-26 12:45 ` jakub at gcc dot gnu.org
@ 2022-01-26 20:48 ` glisse at gcc dot gnu.org
  2022-01-26 21:08 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: glisse at gcc dot gnu.org @ 2022-01-26 20:48 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

--- Comment #2 from Marc Glisse <glisse at gcc dot gnu.org> ---
Thanks for fixing that bug, but don't you still have issues with
NO_WARN_X86_INTRINSICS if you rely on __has_include for immintrin.h?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-01-26 20:48 ` glisse at gcc dot gnu.org
@ 2022-01-26 21:08 ` cvs-commit at gcc dot gnu.org
  2022-01-26 21:56 ` cvs-commit at gcc dot gnu.org
  2022-01-27 11:00 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-26 21:08 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

--- Comment #3 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:2bf8da684b712a16c67f3defc0dd97f175f8f4ad

commit r12-6884-g2bf8da684b712a16c67f3defc0dd97f175f8f4ad
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 26 22:07:29 2022 +0100

    rs6000: Fix up #include <immintrin.h> or <x86gprintrin.h> [PR104239]

    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
    <x86intrin.h>.
    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.

    2022-01-26  Jakub Jelinek  <jakub@redhat.com>

            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.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-01-26 21:08 ` cvs-commit at gcc dot gnu.org
@ 2022-01-26 21:56 ` cvs-commit at gcc dot gnu.org
  2022-01-27 11:00 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-01-26 21:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>:

https://gcc.gnu.org/g:fd5b0488ad5e4f29b65238e06a2d65b7de120235

commit r12-6885-gfd5b0488ad5e4f29b65238e06a2d65b7de120235
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Wed Jan 26 22:55:11 2022 +0100

    rs6000: Fix up *intrin.h for C89 [PR104239]

    When writing testcases for the previously posted patch, I have noticed
    that 3 of the headers aren't valid C89 (I didn't have any dg-options
    so -ansi -pedantic-errors was implied and these errors were reported).

    The following patch fixes those, ok for trunk?

    Note, as can be seen even in this patch, seems older rs6000/*intrin.h
    headers uglify not just argument names (__A instead of A etc.), but also
    automatic variable names and other local identifiers, while e.g.
emmintrin.h
    or bmi2intrin.h clearly uglify only the argument names and not local
    variables.  I think that should be fixed but don't have time for that
myself
    (libstdc++ or e.g. the x86 headers uglify everything; this is so that one
    can
     #define result a + b
     #include <x86intrin.h>
    etc.).

    2022-01-26  Jakub Jelinek  <jakub@redhat.com>

            PR target/104239
            * config/rs6000/emmintrin.h (_mm_sad_epu8): Use __asm__ instead of
            asm.
            * config/rs6000/smmintrin.h (_mm_minpos_epu16): Declare iterator
            before for loop instead of for init clause.
            * config/rs6000/bmi2intrin.h (_pext_u64): Likewise.

            * gcc.target/powerpc/pr104239-3.c: New test.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug target/104239] [12 Regression] immintrin.h or x86gprintrin.h headers can't be included
  2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-01-26 21:56 ` cvs-commit at gcc dot gnu.org
@ 2022-01-27 11:00 ` jakub at gcc dot gnu.org
  5 siblings, 0 replies; 7+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-27 11:00 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104239

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-01-27 11:00 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-26 12:40 [Bug target/104239] New: [12 Regression] immintrin.h or x86gprintrin.h headers can't be included jakub at gcc dot gnu.org
2022-01-26 12:40 ` [Bug target/104239] " jakub at gcc dot gnu.org
2022-01-26 12:45 ` jakub at gcc dot gnu.org
2022-01-26 20:48 ` glisse at gcc dot gnu.org
2022-01-26 21:08 ` cvs-commit at gcc dot gnu.org
2022-01-26 21:56 ` cvs-commit at gcc dot gnu.org
2022-01-27 11:00 ` jakub at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).