https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103859
Bug ID: 103859 Summary: [11 Regression] ICE when functional declaration parameter list contains sized arrays Product: gcc Version: 11.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c Assignee: unassigned at gcc dot gnu.org Reporter: dtorrance at piedmont dot edu Target Milestone: --- I'm getting the following internal compiler error when compiling ts_interpolation.c from PHCpack [1] in Debian unstable using gcc 11.2.0 on a number of architectures (armel, armhf, i386, mipsel, s390x, powerpc, and ppc64). This isn't a problem using gcc 10.3.1. A simple workaround is to switch from p[n] to *p in the function declaration. I've simplified the failing code down to a few lines: $ gcc -c test.c during RTL pass: expand test.c: In function 'main': test.c:16:3: internal compiler error: Segmentation fault 16 | horner(n + 1, f, x[i]); | ^~~~~~~~~~~~~~~~~~~~~~ 0x8ae09e6 internal_error(char const*, ...) ???:0 0x8b5d8c3 get_size_range(range_query*, tree_node*, gimple*, tree_node**, int) ???:0 0x8be739c expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) ???:0 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions. Preprocessed source stored into /tmp/cc2JQxrQ.out file, please attach this to your bugreport. === BEGIN GCC DUMP === 72708: // Target: i686-linux-gnu 72708: // Configured with: ../src/configure -v --with-pkgversion='Debian 11.2.0-13' --with-bugurl=file:///usr/share/doc/gcc-11/README.Bugs --enable-languages=c,ada,c++,go,brig,d,fortran,objc,obj-c++,m2 --prefix=/usr --with-gcc-major-version-only --program-suffix=-11 --program-prefix=i686-linux-gnu- --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --enable-bootstrap --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-plugin --enable-default-pie --with-system-zlib --enable-libphobos-checking=release --with-target-system-zlib=auto --enable-objc-gc=auto --enable-targets=all --enable-multiarch --disable-werror --with-arch-32=i686 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu 72708: // Thread model: posix 72708: // Supported LTO compression algorithms: zlib zstd 72708: // gcc version 11.2.0 (Debian 11.2.0-13) 72708: // 72708: // during RTL pass: expand 72708: // test.c: In function 'main': 72708: // test.c:16:3: internal compiler error: Segmentation fault 72708: // 16 | horner(n + 1, f, x[i]); 72708: // | ^~~~~~~~~~~~~~~~~~~~~~ 72708: // 0x8ae09e6 internal_error(char const*, ...) 72708: // ???:0 72708: // 0x8b5d8c3 get_size_range(range_query*, tree_node*, gimple*, tree_node**, int) 72708: // ???:0 72708: // 0x8be739c expand_expr_real_1(tree_node*, rtx_def*, machine_mode, expand_modifier, rtx_def**, bool) 72708: // ???:0 72708: // Please submit a full bug report, 72708: // with preprocessed source if appropriate. 72708: // Please include the complete backtrace with any bug report. 72708: // See <file:///usr/share/doc/gcc-11/README.Bugs> for instructions. 72708: 72708: // /usr/lib/gcc/i686-linux-gnu/11/cc1 -quiet -imultiarch i386-linux-gnu test.c -quiet -dumpbase test.c -dumpbase-ext .c -mtune=generic -march=i686 -fasynchronous-unwind-tables -o - -frandom-seed=0 -fdump-noaddr 72708: 72708: # 0 "test.c" 72708: # 0 "<built-in>" 72708: # 0 "<command-line>" 72708: # 1 "/usr/include/stdc-predef.h" 1 3 4 72708: # 0 "<command-line>" 2 72708: # 1 "test.c" 72708: typedef struct dcmplx dcmplx; 72708: 72708: struct dcmplx { 72708: double re; 72708: double im; 72708: }; 72708: 72708: dcmplx horner(int n, dcmplx p[n], dcmplx x); 72708: 72708: int main(void) 72708: { 72708: 72708: int i, n; 72708: dcmplx x[n + 1], f[n + 1]; 72708: 72708: horner(n + 1, f, x[i]); 72708: 72708: return 0; 72708: } === END GCC DUMP === [1] https://github.com/janverschelde/PHCpack/blob/master/src/Feedback/ts_interpolation.c