https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110616
Bug ID: 110616 Summary: [14 regression] ICE after r14-2117-gdd86a5a69cbda4 Product: gcc Version: 14.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: tree-optimization Assignee: unassigned at gcc dot gnu.org Reporter: seurer at gcc dot gnu.org Target Milestone: --- g:dd86a5a69cbda40cf76388a65d3317c91cb2b501, r14-2117-gdd86a5a69cbda4 commit dd86a5a69cbda40cf76388a65d3317c91cb2b501 Author: Richard Biener <rguent...@suse.de> Date: Thu Jun 22 11:40:46 2023 +0200 tree-optimization/96208 - SLP of non-grouped loads The ICE only occurs with -mcpu=power7. This is cut down from a much larger test thus the warnings. Note that this still fails with r14-2421-g2c60368ab5706a $ /home/seurer/gcc/git/install/gcc-test/bin/gcc -c -o do_fit.o -DSPEC_CPU -DNDEBUG -I. -DHAVE_CONFIG_H -m64 -O2 -mcpu=power7 failsX.c failsX.c: In function 'calc_similar_ind': failsX.c:32:14: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 32 | return 2*sqrt(rd/rs); | ^~~~ failsX.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt' +++ |+#include <math.h> 1 | typedef int atom_id; failsX.c:32:14: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch] 32 | return 2*sqrt(rd/rs); | ^~~~ failsX.c:32:14: note: include '<math.h>' or provide a declaration of 'sqrt' during GIMPLE pass: vect failsX.c:12:6: internal compiler error: Segmentation fault 12 | real calc_similar_ind(int bRho,int nind,atom_id *index,real mass[], | ^~~~~~~~~~~~~~~~ 0x10cc57eb crash_signal /home/seurer/gcc/git/gcc-test/gcc/toplev.cc:314 0x11d56c7c vect_supportable_dr_alignment(vec_info*, dr_vec_info*, tree_node*, int) /home/seurer/gcc/git/gcc-test/gcc/tree-vect-data-refs.cc:6817 0x11d5ec8f vect_enhance_data_refs_alignment(_loop_vec_info*) /home/seurer/gcc/git/gcc-test/gcc/tree-vect-data-refs.cc:2044 0x1107d363 vect_analyze_loop_2 /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:2772 0x1107ec9b vect_analyze_loop_1 /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:3303 0x1107f5f3 vect_analyze_loop(loop*, vec_info_shared*) /home/seurer/gcc/git/gcc-test/gcc/tree-vect-loop.cc:3457 0x110d4607 try_vectorize_loop_1 /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1064 0x110d4607 try_vectorize_loop /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1180 0x110d4e43 execute /home/seurer/gcc/git/gcc-test/gcc/tree-vectorizer.cc:1296 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. $ /home/seurer/gcc/git/install/gcc-test/bin/gcc -c -o do_fit.o -DSPEC_CPU -DNDEBUG -I. -DHAVE_CONFIG_H -m64 -O2 -mcpu=power8 failsX.c failsX.c: In function 'calc_similar_ind': failsX.c:32:14: warning: implicit declaration of function 'sqrt' [-Wimplicit-function-declaration] 32 | return 2*sqrt(rd/rs); | ^~~~ failsX.c:1:1: note: include '<math.h>' or provide a declaration of 'sqrt' +++ |+#include <math.h> 1 | typedef int atom_id; failsX.c:32:14: warning: incompatible implicit declaration of built-in function 'sqrt' [-Wbuiltin-declaration-mismatch] 32 | return 2*sqrt(rd/rs); | ^~~~ failsX.c:32:14: note: include '<math.h>' or provide a declaration of 'sqrt' $ cat failsX.c typedef int atom_id; typedef float real; typedef real rvec[3]; static real sqr(real x) { return (x*x); } real calc_similar_ind(int bRho,int nind,atom_id *index,real mass[], rvec x[],rvec xp[]) { int i, j, d; real m, tm, xs, xd, rs, rd; tm=0; rs=0; rd=0; for(j=0; j<nind; j++) { i = j; m = mass[i]; tm += m; for(d=0 ; d<3; d++) { xd = x[i][d] - xp[i][d]; rd += m * sqr(xd); xs = x[i][d] + xp[i][d]; rs += m * sqr(xs); } } return 2*sqrt(rd/rs); }