public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables
@ 2022-01-27 11:13 jakub at gcc dot gnu.org
  2022-02-17 19:15 ` [Bug target/104257] " cvs-commit at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-01-27 11:13 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 104257
           Summary: rs6000/*intrin.h headers using non-uglified automatic
                    variables
           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: ---

As I've mentioned in
https://gcc.gnu.org/pipermail/gcc-patches/2022-January/589296.html
various config/rs6000/*intrin.h headers, while they uglify parameter names,
don't uglify automatic variables/local types etc. in the inline functions.
Example of proper uglification:
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_blend_epi16 (__m128i __A, __m128i __B, const int __imm8)
{ 
  __v16qi __charmask = vec_splats ((signed char) __imm8);
  __charmask = vec_gb (__charmask);
  __v8hu __shortmask = (__v8hu) vec_unpackh (__charmask);
  #ifdef __BIG_ENDIAN__
  __shortmask = vec_reve (__shortmask);
  #endif
  return (__m128i) vec_sel ((__v8hu) __A, (__v8hu) __B, __shortmask);
}
example of missing uglification:
extern __inline __m128i __attribute__((__gnu_inline__, __always_inline__,
__artificial__))
_mm_insert_epi8 (__m128i const __A, int const __D, int const __N)
{
  __v16qi result = (__v16qi)__A;

  result [__N & 0xf] = __D;

  return (__m128i) result;
}

result isn't a reserved identifier, so
#define result 1 + 2
#include <x86intrin.h>
will not work.

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
@ 2022-02-17 19:15 ` cvs-commit at gcc dot gnu.org
  2022-02-17 19:41 ` pc at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-17 19:15 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Clarke <pc@gcc.gnu.org>:

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

commit r12-7284-gefbb17db52afd802300c4dcce208fab326ec2915
Author: Paul A. Clarke <pc@us.ibm.com>
Date:   Wed Feb 16 20:01:41 2022 -0600

    rs6000: __Uglify non-uglified local variables in headers

    Properly prefix (with "__")  all local variables in shipped headers for x86
    compatibility intrinsics implementations.  This avoids possible problems
with
    usages like:
    ```
    ```

    2022-02-16  Paul A. Clarke  <pc@us.ibm.com>

    gcc
            PR target/104257
            * config/rs6000/bmi2intrin.h: Uglify local variables.
            * config/rs6000/emmintrin.h: Likewise.
            * config/rs6000/mm_malloc.h: Likewise.
            * config/rs6000/mmintrin.h: Likewise.
            * config/rs6000/pmmintrin.h: Likewise.
            * config/rs6000/smmintrin.h: Likewise.
            * config/rs6000/tmmintrin.h: Likewise.
            * config/rs6000/xmmintrin.h: Likewise.

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
  2022-02-17 19:15 ` [Bug target/104257] " cvs-commit at gcc dot gnu.org
@ 2022-02-17 19:41 ` pc at gcc dot gnu.org
  2022-02-18 16:23 ` cvs-commit at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: pc at gcc dot gnu.org @ 2022-02-17 19:41 UTC (permalink / raw)
  To: gcc-bugs

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

pc at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pc at gcc dot gnu.org
     Ever confirmed|0                           |1
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2022-02-17

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
  2022-02-17 19:15 ` [Bug target/104257] " cvs-commit at gcc dot gnu.org
  2022-02-17 19:41 ` pc at gcc dot gnu.org
@ 2022-02-18 16:23 ` cvs-commit at gcc dot gnu.org
  2022-05-19 21:59 ` bergner at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-02-18 16:23 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:df5ed150ee5fbcb8255e05eed978c4af2b3d9bcc

commit r12-7294-gdf5ed150ee5fbcb8255e05eed978c4af2b3d9bcc
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Fri Feb 18 17:21:43 2022 +0100

    rs6000: Fix up posix_memalign call in _mm_malloc [PR104598]

    The uglification changes went in one spot too far and uglified also
    the anem of function, posix_memalign should be called like that and
    not a non-existent function instead of it.

    2022-02-18  Jakub Jelinek  <jakub@redhat.com>

            PR target/104257
            PR target/104598
            * config/rs6000/mm_malloc.h (_mm_malloc): Call posix_memalign
            rather than __posix_memalign.

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2022-02-18 16:23 ` cvs-commit at gcc dot gnu.org
@ 2022-05-19 21:59 ` bergner at gcc dot gnu.org
  2022-05-23 16:52 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: bergner at gcc dot gnu.org @ 2022-05-19 21:59 UTC (permalink / raw)
  To: gcc-bugs

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

Peter Bergner <bergner at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bergner at gcc dot gnu.org

--- Comment #3 from Peter Bergner <bergner at gcc dot gnu.org> ---
Is this fixed and can be closed?  ...or does this need to be backported?

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-05-19 21:59 ` bergner at gcc dot gnu.org
@ 2022-05-23 16:52 ` cvs-commit at gcc dot gnu.org
  2022-05-23 18:17 ` cvs-commit at gcc dot gnu.org
  2022-05-23 18:35 ` pc at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-23 16:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Paul Clarke <pc@gcc.gnu.org>:

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

commit r11-10027-gd81a2efb2a704b2d95d40f0fa538c2283de2e98d
Author: Paul A. Clarke <pc@us.ibm.com>
Date:   Mon May 23 11:39:57 2022 -0500

    rs6000: __Uglify non-uglified local variables in headers

    Properly prefix (with "__")  all local variables in shipped headers for x86
    compatibility intrinsics implementations.  This avoids possible problems
with
    usages like:
    ```
     #define result foo()
     #include <emmintrin.h>
    ```

    2022-05-23  Paul A. Clarke  <pc@us.ibm.com>

    gcc
            PR target/104257
            * config/rs6000/bmi2intrin.h: Uglify local variables.
            * config/rs6000/emmintrin.h: Likewise.
            * config/rs6000/mm_malloc.h: Likewise.
            * config/rs6000/mmintrin.h: Likewise.
            * config/rs6000/pmmintrin.h: Likewise.
            * config/rs6000/smmintrin.h: Likewise.
            * config/rs6000/tmmintrin.h: Likewise.
            * config/rs6000/xmmintrin.h: Likewise.

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-05-23 16:52 ` cvs-commit at gcc dot gnu.org
@ 2022-05-23 18:17 ` cvs-commit at gcc dot gnu.org
  2022-05-23 18:35 ` pc at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2022-05-23 18:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Paul Clarke <pc@gcc.gnu.org>:

https://gcc.gnu.org/g:41b1ff05e2686a9b47c2b3c95b3961d5f176fa50

commit r10-10756-g41b1ff05e2686a9b47c2b3c95b3961d5f176fa50
Author: Paul A. Clarke <pc@us.ibm.com>
Date:   Mon May 23 13:14:45 2022 -0500

    rs6000: __Uglify non-uglified local variables in headers

    Properly prefix (with "__")  all local variables in shipped headers for x86
    compatibility intrinsics implementations.  This avoids possible problems
with
    usages like:
    ```
     #define result foo()
     #include <emmintrin.h>
    ```

    2022-05-23  Paul A. Clarke  <pc@us.ibm.com>

    gcc
            PR target/104257
            * config/rs6000/bmi2intrin.h: Uglify local variables.
            * config/rs6000/emmintrin.h: Likewise.
            * config/rs6000/mm_malloc.h: Likewise.
            * config/rs6000/mmintrin.h: Likewise.
            * config/rs6000/pmmintrin.h: Likewise.
            * config/rs6000/tmmintrin.h: Likewise.
            * config/rs6000/xmmintrin.h: Likewise.

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

* [Bug target/104257] rs6000/*intrin.h headers using non-uglified automatic variables
  2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-05-23 18:17 ` cvs-commit at gcc dot gnu.org
@ 2022-05-23 18:35 ` pc at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: pc at gcc dot gnu.org @ 2022-05-23 18:35 UTC (permalink / raw)
  To: gcc-bugs

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

pc at gcc dot gnu.org changed:

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

--- Comment #6 from pc at gcc dot gnu.org ---
Fixed on trunk (in gcc-12 window, including a subsequent fix for the fix by
Jakub (Thanks!)), backported (without the issue requiring the subsequent fix)
to gcc-11 and gcc-10. Closing.

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

end of thread, other threads:[~2022-05-23 18:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-27 11:13 [Bug target/104257] New: rs6000/*intrin.h headers using non-uglified automatic variables jakub at gcc dot gnu.org
2022-02-17 19:15 ` [Bug target/104257] " cvs-commit at gcc dot gnu.org
2022-02-17 19:41 ` pc at gcc dot gnu.org
2022-02-18 16:23 ` cvs-commit at gcc dot gnu.org
2022-05-19 21:59 ` bergner at gcc dot gnu.org
2022-05-23 16:52 ` cvs-commit at gcc dot gnu.org
2022-05-23 18:17 ` cvs-commit at gcc dot gnu.org
2022-05-23 18:35 ` pc 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).