[Bug c/108914] New: during RTL pass: internal compiler error

2023-02-23 Thread andreas.kanzler at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108914

Bug ID: 108914
   Summary: during RTL pass: internal compiler error
   Product: gcc
   Version: 11.3.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c
  Assignee: unassigned at gcc dot gnu.org
  Reporter: andreas.kanzler at outlook dot com
  Target Milestone: ---

I noticed this bug in my current project. It occurs from GCC 10.3 or 10.4. The
project compiles with GCC 9.4 and 10.2 without problems, all versions above
seem to be affected.
I tested 9.4, 10.2, 10.4, 11.3 and 12.1 in Linux (Ubuntu 22.04 LTS and 20.04
LTS, Native and under Windows 11/WSL) and under Cygwin64, here only GCC 10.2
and 11.3.

Error Message from Cygwin, the error occurs during linking:
during RTL pass: ira
/cygdrive/e/RC-Dev/inav/src/main/fc/fc_core.c: In function ‘getAxisRcCommand’:
/cygdrive/e/RC-Dev/inav/src/main/fc/fc_core.c:170:1: internal compiler error:
Segmentation fault
  170 | }
  | ^
Please submit a full bug report,
with preprocessed source if appropriate.
See  for instructions.
lto-wrapper: fatal error: /usr/bin/gcc returned 1 exit status
compilation terminated.
/usr/lib/gcc/x86_64-pc-cygw

Output from cmake, here from cygwin, but its similar in Linux/WSL
Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
Target: x86_64-pc-cygwin
Configured with: /mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-11.3.0/configure
--srcdir=/mnt/share/cygpkgs/gcc/gcc.x86_64/src/gcc-11.3.0 --prefix=/usr
--exec-prefix=/usr --localstatedir=/var --sysconfdir=/etc
--docdir=/usr/share/doc/gcc --htmldir=/usr/share/doc/gcc/html -C
--build=x86_64-pc-cygwin --host=x86_64-pc-cygwin --target=x86_64-pc-cygwin
--without-libiconv-prefix --without-libintl-prefix --libexecdir=/usr/lib
--with-gcc-major-version-only --enable-shared --enable-shared-libgcc
--enable-static --enable-version-specific-runtime-libs --enable-bootstrap
--enable-__cxa_atexit --with-dwarf2 --with-tune=generic
--enable-languages=c,c++,fortran,lto,objc,obj-c++,jit --enable-graphite
--enable-threads=posix --enable-libatomic --enable-libgomp --enable-libquadmath
--enable-libquadmath-support --disable-libssp --enable-libada --disable-symvers
--with-gnu-ld --with-gnu-as --with-cloog-include=/usr/include/cloog-isl
--without-libiconv-prefix --without-libintl-prefix --with-system-zlib
--enable-linker-build-id --with-default-libstdcxx-abi=gcc4-compatible
--enable-libstdcxx-filesystem-ts
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 11.3.0 (GCC)

COLLECT_GCC_OPTIONS='-D' 'FC_VERSION_MAJOR=6' '-D' 'FC_VERSION_MINOR=0' '-D'
'FC_VERSION_PATCH_LEVEL=0' '-D' 'HSE_VALUE=800' '-D' 'SITL' '-D'
'SITL_BUILD' '-D' '__FORKNAME__=inav' '-D' '__REVISION__="1af0e611"' '-D'
'__TARGET__="SITL"' '-I' '/cygdrive/e/RC-Dev/inav/src/main/target/SITL' '-I'
'/cygdrive/e/RC-Dev/inav/release/src/main/target/SITL/SITL' '-I'
'/cygdrive/e/RC-Dev/inav/lib' '-I' '/cygdrive/e/RC-Dev/inav/src/main' '-I'
'/cygdrive/e/RC-Dev/inav/lib/main/MAVLink' '-ggdb3' '-Os' '-D' 'NDEBUG' '-flto'
'-fno-fat-lto-objects' '-Wformat=0' '-Wno-return-local-addr'
'-fsingle-precision-constant' '-funsigned-char' '-v' '-save-temps' '-Wall'
'-Wextra' '-Wdouble-promotion' '-Wstrict-prototypes' '-Werror=switch'
'-std=gnu99' '-MD' '-MT'
'src/main/target/SITL/CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.o'
'-MF' 'CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.o.d' '-o'
'CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.o' '-c' '-mtune=generic'
'-march=x86-64' '-dumpdir' 'CMakeFiles/SITL.elf.dir/__/__/telemetry/'
 /usr/lib/gcc/x86_64-pc-cygwin/11/cc1.exe -E -quiet -v -I
/cygdrive/e/RC-Dev/inav/src/main/target/SITL -I
/cygdrive/e/RC-Dev/inav/release/src/main/target/SITL/SITL -I
/cygdrive/e/RC-Dev/inav/lib -I /cygdrive/e/RC-Dev/inav/src/main -I
/cygdrive/e/RC-Dev/inav/lib/main/MAVLink -MD
CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.d -MF
CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.o.d -MT
src/main/target/SITL/CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.o -dD
-idirafter /usr/lib/gcc/x86_64-pc-cygwin/11/../../../../lib/../include/w32api
-idirafter
/usr/lib/gcc/x86_64-pc-cygwin/11/../../../../x86_64-pc-cygwin/lib/../lib/../../include/w32api
-D FC_VERSION_MAJOR=6 -D FC_VERSION_MINOR=0 -D FC_VERSION_PATCH_LEVEL=0 -D
HSE_VALUE=800 -D SITL -D SITL_BUILD -D __FORKNAME__=inav -D
__REVISION__="1af0e611" -D __TARGET__="SITL" -D NDEBUG
/cygdrive/e/RC-Dev/inav/src/main/telemetry/telemetry.c -mtune=generic
-march=x86-64 -std=gnu99 -Wformat=0 -Wno-return-local-addr -Wall -Wextra
-Wdouble-promotion -Wstrict-prototypes -Werror=switch -flto
-fno-fat-lto-objects -fsingle-precision-constant -funsigned-char -ggdb3
-fworking-directory -Os -fpch-preprocess -o
CMakeFiles/SITL.elf.dir/__/__/telemetry/telemetry.c.i
ignoring nonexistent directory "/usr/local/include"
ignoring nonexistent directory "/usr/lib/gcc/x86_64-pc-cygwin/11/incl

[Bug c/108914] during RTL pass: internal compiler error

2023-02-23 Thread andreas.kanzler at outlook dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108914

--- Comment #1 from Andreas Kanzler  ---
Created attachment 54524
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=54524&action=edit
preprocessed file