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

            Bug ID: 127511
           Summary: libbacktrace link fails with ICE in lto1 (out of
                    bounds access)
           Product: gcc
           Version: 17.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
          Assignee: unassigned at gcc dot gnu.org
          Reporter: heiko at hexco dot de
  Target Milestone: ---

During 'make check' on linux x64 for commit
'b627bfa76649bb65ccab8d9aad9c1b1f1d45cdde'

I get
```
libtool: link: /home/heiko/gcc/objdir/./prev-gcc/xgcc
-B/home/heiko/gcc/objdir/./prev-gcc/ -B/usr/local/x86_64-pc-linux-gnu/bin/
-B/usr/local/x86_64-pc-linux-gnu/bin/ -B/usr/local/x86_64-pc-linux-gnu/lib/
-isystem /usr/local/x86_64-pc-linux-gnu/include -isystem
/usr/local/x86_64-pc-linux-gnu/sys-include -funwind-tables
-frandom-seed=btest_lto -W -Wall -Wwrite-strings -Wstrict-prototypes
-Wmissing-prototypes -Wold-style-definition -Wmissing-format-attribute
-Wcast-qual -Wno-attributes -Wpointer-arith -g -O -flto -g -O2
-static-libstdc++ -static-libgcc -o btest_lto btest_lto-btest.o
btest_lto-testlib.o  ./.libs/libbacktrace.a
lto1: internal compiler error: in operator[], at vec.h:911
/home/heiko/gcc/objdir/./prev-gcc/lto1 -quiet -dumpbase ./btest_lto.wpa
-mtune=generic -march=x86-64 -g -g -g -O2 -O2 -O -O2 -Wextra -Wno-attributes
-fno-openmp -fno-openacc -fPIE -fcf-protection=none -funwind-tables
-frandom-seed=btest_lto -fltrans-output-list=/tmp/ccCp7YfX.ltrans.out -fwpa
-fresolution=/tmp/ccU0oBgM.res -flinker-output=pie @/tmp/ccin3Dfj
Please submit a full bug report, with preprocessed source (by using
-freport-bug).
See <https://gcc.gnu.org/bugs/> for instructions.
```

configuration info:
Configured with: ../configure --enable-host-shared --disable-multilib
--enable-maintainer-mode --enable-default-pie --enable-checking
--enable-sanitizers
--enable-languages=c,algol68,cobol,c++,d,fortran,go,jit,lto,m2,objc,obj-c++ :
(reconfigured) ../configure --enable-host-shared --disable-multilib
--enable-maintainer-mode --enable-default-pie --enable-checking
--enable-sanitizers
--enable-languages=c,algol68,cobol,c++,d,fortran,go,jit,lto,m2,objc,obj-c++ :
(reconfigured) ../configure --enable-host-shared --disable-multilib
--enable-maintainer-mode --enable-default-pie --enable-checking
--enable-sanitizers
--enable-languages=c,algol68,cobol,c++,d,fortran,go,jit,lto,m2,objc,obj-c++
--no-create --no-recursion

The triggered assertion is:
```
  gcc_checking_assert (ix < m_vecpfx.m_num);
```

in
```
template<typename T, typename A>
inline T &
vec<T, A, vl_embed>::operator[] (unsigned ix)
{
  gcc_checking_assert (ix < m_vecpfx.m_num);
  return address ()[ix];
}
```

Reply via email to