Bug 2161928 - ICE when expanding __builtin_aarch64_rndr
Summary: ICE when expanding __builtin_aarch64_rndr
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Fedora
Classification: Fedora
Component: gcc
Version: 37
Hardware: aarch64
OS: Linux
unspecified
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-01-18 10:48 UTC by Dmitry Antipov
Modified: 2023-01-23 11:57 UTC (History)
11 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2023-01-23 11:57:46 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
GNU Compiler Collection 108495 0 P2 UNCONFIRMED [10/11/12/13 Regression] aarch64 ICE with __builtin_aarch64_rndr 2023-01-23 11:57:45 UTC

Description Dmitry Antipov 2023-01-18 10:48:46 UTC
Description of problem:

$ gcc t-rand.c 
t-rand.c: In function ‘main’:
t-rand.c:5:1: error: unrecognizable insn:
    5 | }
      | ^
(insn 8 7 9 2 (parallel [
            (set (reg:DI 94)
                (unspec_volatile:DI [
                        (const_int 0 [0])
                    ] UNSPEC_RNDR))
            (set (reg:CC_Z 66 cc)
                (unspec_volatile:CC_Z [
                        (const_int 0 [0])
                    ] UNSPEC_RNDR))
        ]) "t-rand.c":3:3 -1
     (nil))
during RTL pass: vregs
t-rand.c:5:1: internal compiler error: in extract_insn, at recog.cc:2791

Version-Release number of selected component (if applicable):

$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/aarch64-redhat-linux/12/lto-wrapper
Target: aarch64-redhat-linux
Configured with: ../configure --enable-bootstrap --enable-languages=c,c++,fortran,objc,obj-c++,ada,go,d,lto --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-bugurl=http://bugzilla.redhat.com/bugzilla --enable-shared --enable-threads=posix --enable-checking=release --enable-multilib --with-system-zlib --enable-__cxa_atexit --disable-libunwind-exceptions --enable-gnu-unique-object --enable-linker-build-id --with-gcc-major-version-only --enable-libstdcxx-backtrace --with-linker-hash-style=gnu --enable-plugin --enable-initfini-array --with-isl=/builddir/build/BUILD/gcc-12.2.1-20221121/obj-aarch64-redhat-linux/isl-install --enable-gnu-indirect-function --build=aarch64-redhat-linux --with-build-config=bootstrap-lto --enable-link-serialization=1
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 12.2.1 20221121 (Red Hat 12.2.1-4) (GCC) 

How reproducible:

$ cat t-rand.c 
int main (int argc, char *argv[]) {
  unsigned long v;
  __builtin_aarch64_rndr (&v);
  return 0;
}

Comment 1 Jakub Jelinek 2023-01-23 11:57:46 UTC
This is user error, you should use the __rndr intrinsic from <arm_ecle.h>, this builtin is just an internal implementation detail for that.

That said, GCC shouldn't ICE even on bogus input, so I've filed upstream PR108495 for it.
But am not going to track that further on the Fedora side.


Note You need to log in before you can comment on or make changes to this bug.