public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
@ 2023-01-23 11:53 jakub at gcc dot gnu.org
  2023-01-23 11:53 ` [Bug target/108495] " jakub at gcc dot gnu.org
                   ` (15 more replies)
  0 siblings, 16 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-23 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 108495
           Summary: [10/11/12/13 Regression] aarch64 ICE with
                    __builtin_aarch64_rndr
           Product: gcc
           Version: 13.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: ---

int
main ()
{
  unsigned long v;
  __builtin_aarch64_rndr (&v);
  return 0;
}

ICEs on aarch64 unless compiled with -march that includes rng.
Maybe other builtins do too.
GCC 4.8 didn't support the builtin and didn't ICE (so it is a regression), GCC
8 already ICEs on it.

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
@ 2023-01-23 11:53 ` jakub at gcc dot gnu.org
  2023-01-23 12:09 ` ktkachov at gcc dot gnu.org
                   ` (14 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-23 11:53 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2
   Target Milestone|---                         |10.5
                 CC|                            |ktkachov at gcc dot gnu.org,
                   |                            |rearnsha at gcc dot gnu.org,
                   |                            |rsandifo at gcc dot gnu.org

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
  2023-01-23 11:53 ` [Bug target/108495] " jakub at gcc dot gnu.org
@ 2023-01-23 12:09 ` ktkachov at gcc dot gnu.org
  2023-01-23 12:12 ` jakub at gcc dot gnu.org
                   ` (13 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2023-01-23 12:09 UTC (permalink / raw)
  To: gcc-bugs

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

ktkachov at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|                            |2023-01-23
             Status|UNCONFIRMED                 |NEW

--- Comment #1 from ktkachov at gcc dot gnu.org ---
Confirmed. That said, __builtin_aarch64_rndr is not supposed to be used
directly by the user. They should include <arm_acle.h> and use the __rndr
intrinsic instead.
That will give the appropriate error:
inlining failed in call to 'always_inline' '__rndr': target specific option
mismatch

Still, I suppose the compiler shouldn't ICE

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
  2023-01-23 11:53 ` [Bug target/108495] " jakub at gcc dot gnu.org
  2023-01-23 12:09 ` ktkachov at gcc dot gnu.org
@ 2023-01-23 12:12 ` jakub at gcc dot gnu.org
  2023-01-25  8:25 ` dantipov at cloudlinux dot com
                   ` (12 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-23 12:12 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I know, that is basically what I told the reporter in
https://bugzilla.redhat.com/show_bug.cgi?id=2161928

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-01-23 12:12 ` jakub at gcc dot gnu.org
@ 2023-01-25  8:25 ` dantipov at cloudlinux dot com
  2023-01-25  8:32 ` jakub at gcc dot gnu.org
                   ` (11 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: dantipov at cloudlinux dot com @ 2023-01-25  8:25 UTC (permalink / raw)
  To: gcc-bugs

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

Dmitry Antipov <dantipov at cloudlinux dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dantipov at cloudlinux dot com

--- Comment #3 from Dmitry Antipov <dantipov at cloudlinux dot com> ---
Thanks. BTW is it possible to make the diagnostics some more
developer-friendly? In particular, plain 'gcc test.c' doesn't specify any
target-specific options explicitly, and it may be required to look through
'arm_acle.h' to realize that the thing like 'gcc -march=armv8.5-a+rng test.c'
is required instead.

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2023-01-25  8:25 ` dantipov at cloudlinux dot com
@ 2023-01-25  8:32 ` jakub at gcc dot gnu.org
  2023-01-25  8:40 ` dantipov at cloudlinux dot com
                   ` (10 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-25  8:32 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Why?  You shouldn't use the builtins directly, they are implementation detail
for implementing the intrinsics and the intrinsics don't suffer ever from this
problem
because they ensure the correct target options already.

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2023-01-25  8:32 ` jakub at gcc dot gnu.org
@ 2023-01-25  8:40 ` dantipov at cloudlinux dot com
  2023-01-25  8:49 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: dantipov at cloudlinux dot com @ 2023-01-25  8:40 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #5 from Dmitry Antipov <dantipov at cloudlinux dot com> ---
# cat t-rand.c 
#include <stdint.h>
#include <arm_acle.h>

int main(int argc, char *argv[]) {
  uint64_t v;
  __rndr(&v);
  return 0;
}

# gcc t-rand.c 
In file included from t-rand.c:2:
/usr/lib/gcc/aarch64-redhat-linux/12/include/arm_acle.h: In function ‘main’:
/usr/lib/gcc/aarch64-redhat-linux/12/include/arm_acle.h:313:1: error: inlining
failed in call to ‘always_inline’ ‘__rndr’: target specific option mismatch
  313 | __rndr (uint64_t *__res)
      | ^~~~~~
t-rand.c:6:3: note: called from here
    6 |   __rndr(&v);
      |   ^~~~~~~~~~

So, what target-specific option is wrong if none of them was specified?

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2023-01-25  8:40 ` dantipov at cloudlinux dot com
@ 2023-01-25  8:49 ` jakub at gcc dot gnu.org
  2023-01-25  9:11 ` ktkachov at gcc dot gnu.org
                   ` (8 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: jakub at gcc dot gnu.org @ 2023-01-25  8:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
That message indeed could at least print the diff between the target options of
the caller and callee as a follow-up note.

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

* [Bug target/108495] [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2023-01-25  8:49 ` jakub at gcc dot gnu.org
@ 2023-01-25  9:11 ` ktkachov at gcc dot gnu.org
  2023-07-07 10:44 ` [Bug target/108495] [11/12/13/14 " rguenth at gcc dot gnu.org
                   ` (7 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: ktkachov at gcc dot gnu.org @ 2023-01-25  9:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from ktkachov at gcc dot gnu.org ---
Yes, GCC could be more helpful here. The intrinsics and their use is documented
in the ACLE document:
https://github.com/ARM-software/acle/blob/main/main/acle.md#random-number-generation-intrinsics
There is work ongoing to augument it with more user-friendly information about
compiler flags, but GCC could keep track of the options used to gate these
builtins/intrinsics and report a hint

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2023-01-25  9:11 ` ktkachov at gcc dot gnu.org
@ 2023-07-07 10:44 ` rguenth at gcc dot gnu.org
  2024-02-21  5:23 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.5

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2023-07-07 10:44 ` [Bug target/108495] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-02-21  5:23 ` pinskia at gcc dot gnu.org
  2024-02-21  5:52 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  5:23 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org

--- Comment #9 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I have a (simple) fix.
Just need to tweak the exact error message.

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2024-02-21  5:23 ` pinskia at gcc dot gnu.org
@ 2024-02-21  5:52 ` pinskia at gcc dot gnu.org
  2024-02-21  6:04 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  5:52 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Created attachment 57476
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=57476&action=edit
Current patch

The error message needs some tweaking but this is basically the patch. Will
also add a few testcases too.

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (10 preceding siblings ...)
  2024-02-21  5:52 ` pinskia at gcc dot gnu.org
@ 2024-02-21  6:04 ` pinskia at gcc dot gnu.org
  2024-02-21  6:08 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  6:04 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The CRC functions need a similar handling, e.g.:
```
int
f ()
{
  unsigned long v;
  return __builtin_aarch64_crc32b (v, v);
}
```

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (11 preceding siblings ...)
  2024-02-21  6:04 ` pinskia at gcc dot gnu.org
@ 2024-02-21  6:08 ` pinskia at gcc dot gnu.org
  2024-02-21  6:10 ` pinskia at gcc dot gnu.org
                   ` (2 subsequent siblings)
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  6:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Likewise for the __builtin_aarch64_fcmla_laneq* builtins:

```
#define vect64 __attribute__((vector_size(8)))
#define vect128 __attribute__((vector_size(16)))
int
m ()
{
  unsigned long v;
  vect64 float t;
  vect128 float t1;
  __builtin_aarch64_fcmla_laneq0v2sf(t,t,t1,0);
}
```

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (12 preceding siblings ...)
  2024-02-21  6:08 ` pinskia at gcc dot gnu.org
@ 2024-02-21  6:10 ` pinskia at gcc dot gnu.org
  2024-02-21  6:11 ` pinskia at gcc dot gnu.org
  2024-02-21 17:19 ` pinskia at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  6:10 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
And __builtin_aarch64_jcvtzs:


```
int
m ()
{
  __builtin_aarch64_jcvtzs(1.0);
}
```

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (13 preceding siblings ...)
  2024-02-21  6:10 ` pinskia at gcc dot gnu.org
@ 2024-02-21  6:11 ` pinskia at gcc dot gnu.org
  2024-02-21 17:19 ` pinskia at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21  6:11 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
I think the rest are handled correctly but I have not audited everyone yet.

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

* [Bug target/108495] [11/12/13/14 Regression] aarch64 ICE with __builtin_aarch64_rndr
  2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
                   ` (14 preceding siblings ...)
  2024-02-21  6:11 ` pinskia at gcc dot gnu.org
@ 2024-02-21 17:19 ` pinskia at gcc dot gnu.org
  15 siblings, 0 replies; 17+ messages in thread
From: pinskia at gcc dot gnu.org @ 2024-02-21 17:19 UTC (permalink / raw)
  To: gcc-bugs

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

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=90798

--- Comment #15 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to ktkachov from comment #7)
> Yes, GCC could be more helpful here. 

And the diagnostic issue with target option mismatch is recorded in PR 90798
though there might be some target specific changes needed really.

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

end of thread, other threads:[~2024-02-21 17:20 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-23 11:53 [Bug target/108495] New: [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr jakub at gcc dot gnu.org
2023-01-23 11:53 ` [Bug target/108495] " jakub at gcc dot gnu.org
2023-01-23 12:09 ` ktkachov at gcc dot gnu.org
2023-01-23 12:12 ` jakub at gcc dot gnu.org
2023-01-25  8:25 ` dantipov at cloudlinux dot com
2023-01-25  8:32 ` jakub at gcc dot gnu.org
2023-01-25  8:40 ` dantipov at cloudlinux dot com
2023-01-25  8:49 ` jakub at gcc dot gnu.org
2023-01-25  9:11 ` ktkachov at gcc dot gnu.org
2023-07-07 10:44 ` [Bug target/108495] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-02-21  5:23 ` pinskia at gcc dot gnu.org
2024-02-21  5:52 ` pinskia at gcc dot gnu.org
2024-02-21  6:04 ` pinskia at gcc dot gnu.org
2024-02-21  6:08 ` pinskia at gcc dot gnu.org
2024-02-21  6:10 ` pinskia at gcc dot gnu.org
2024-02-21  6:11 ` pinskia at gcc dot gnu.org
2024-02-21 17:19 ` pinskia 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).