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

            Bug ID: 124776
           Summary: [13/14/15/16 regression] ICE with weak+alias
                    attributes and LTO
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code, lto
          Severity: normal
          Priority: P3
         Component: tree-optimization
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sjames at gcc dot gnu.org
  Target Milestone: ---

name-cache.i:
```
unsigned int hurd_ihash_hash32(void *, unsigned long, unsigned int);

void hash_name() {
    long h = hurd_ihash_hash32(hash_name, 0, h);
}
```

murmu3.i:
```
char MurmurHash3_x86_32_tail_0;
unsigned MurmurHash3_x86_32(void *, unsigned long, unsigned seed) {
  int h1 = seed ^= MurmurHash3_x86_32_tail_0;
  return h1;
}

unsigned hurd_ihash_hash32(void *, unsigned long, unsigned)
    __attribute__((weak, alias("MurmurHash3_x86_32")));
```

```
$ gcc -O1 -flto -shared name-cache.i murmur3.i
during GIMPLE pass: alias
name-cache.i: In function ‘hash_name’:
name-cache.i:2:6: internal compiler error: in handle_call_arg, at
gimple-ssa-pta-constraints.cc:1362
    2 | void hash_name() { long h = hurd_ihash_hash32(hash_name, 0, h); }
      |      ^
/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto1 -quiet -dumpbase
./a.ltrans0.ltrans -mtls-dialect=gnu2 -mtune=generic -march=x86-64
-mtls-dialect=gnu2 -O1 -O1 -fno-openmp -fno-openacc -fPIE -fcf-protection=none
-fltrans -foffload-options=-fno-stack-protector /tmp/ccqeUY4m.ltrans0.o -o
/tmp/ccRAfyEe.s
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://bugs.gentoo.org/> for instructions.
make: *** [/tmp/ccJY9ItP.mk:2: /tmp/ccqeUY4m.ltrans0.ltrans.o] Error 1
lto-wrapper: fatal error: make returned 2 exit status
compilation terminated.
/usr/x86_64-pc-linux-gnu/binutils-bin/9999/ld: error: lto-wrapper failed
collect2: error: ld returned 1 exit status
```

```
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-pc-linux-gnu/16/lto-wrapper
OFFLOAD_TARGET_NAMES=nvptx-none
OFFLOAD_TARGET_DEFAULT=1
Target: x86_64-pc-linux-gnu
Configured with:
/var/tmp/portage.notmp/portage/sys-devel/gcc-16.0.9999/work/gcc-16.0.9999/configure
--host=x86_64-pc-linux-gnu --build=x86_64-pc-linux-gnu --prefix=/usr
--bindir=/usr/x86_64-pc-linux-gnu/gcc-bin/16
--includedir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include
--datadir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16
--mandir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/man
--infodir=/usr/share/gcc-data/x86_64-pc-linux-gnu/16/info
--with-gxx-include-dir=/usr/lib/gcc/x86_64-pc-linux-gnu/16/include/g++-v16
--disable-silent-rules --disable-dependency-tracking
--with-python-dir=/share/gcc-data/x86_64-pc-linux-gnu/16/python
--enable-libphobos --enable-objc-gc
--enable-languages=c,c++,d,go,objc,obj-c++,fortran,ada,cobol,algol68,m2,rust,jit
--enable-obsolete --enable-secureplt --disable-werror --with-system-zlib
--enable-nls --without-included-gettext --disable-libunwind-exceptions
--enable-checking=yes,extra,rtl --with-bugurl=https://bugs.gentoo.org/
--with-pkgversion='Gentoo Hardened 16.0.9999 p, commit
d3da3e70e5c881720e664f09349919fcd6d15c4f' --with-gcc-major-version-only
--enable-libstdcxx-time --enable-lto --disable-libstdcxx-pch
--enable-linker-build-id --enable-libada --enable-shared --enable-threads=posix
--enable-__cxa_atexit --enable-clocale=gnu --with-tls=gnu2 --enable-multilib
--with-multilib-list=m32,mx32,m64 --disable-fixed-point --with-abi=m64
--enable-targets=all --enable-offload-defaulted
--enable-offload-targets=nvptx-none --enable-libgomp --disable-libssp
--disable-cet --enable-systemtap --enable-valgrind-annotations
--enable-valgrind-interop --disable-vtable-verify --disable-libvtv --with-zstd
--with-isl --disable-isl-version-check --enable-default-pie --enable-host-pie
--enable-host-bind-now --enable-default-ssp --disable-fixincludes
--with-gxx-libcxx-include-dir=/usr/include/c++/v1 --enable-host-shared
--enable-libgdiagnostics --with-build-config='bootstrap-O3 bootstrap-lto'
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 16.0.1 20260401 (experimental)
6487521cc18830771e2ac17d9af0b60c9de088ab (Gentoo Hardened 16.0.9999 p, commit
d3da3e70e5c881720e664f09349919fcd6d15c4f)
```

Reply via email to