Error: >$ g++ -c -O3 func.cpp during GIMPLE pass: slp func.cpp: In function ‘void test()’: func.cpp:8:6: internal compiler error: in check_loop_closed_ssa_def, at tree-ssa-loop-manip.c:726 8 | void test() { | ^~~~ 0x84b706 check_loop_closed_ssa_def /home/vlivinsk/workspace/gcc/gcc_src/gcc/tree-ssa-loop-manip.c:726 0x12ae78d check_loop_closed_ssa_bb /home/vlivinsk/workspace/gcc/gcc_src/gcc/tree-ssa-loop-manip.c:752 0x12b05d6 verify_loop_closed_ssa(bool, loop*) /home/vlivinsk/workspace/gcc/gcc_src/gcc/tree-ssa-loop-manip.c:777 0x12b05d6 verify_loop_closed_ssa(bool, loop*) /home/vlivinsk/workspace/gcc/gcc_src/gcc/tree-ssa-loop-manip.c:761 0x1062c24 execute_function_todo /home/vlivinsk/workspace/gcc/gcc_src/gcc/passes.c:2057 0x10638ae execute_todo /home/vlivinsk/workspace/gcc/gcc_src/gcc/passes.c:2093 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions. Reproducer: #include <algorithm> extern long var_2; extern int var_3, var_8; extern long long var_5; extern unsigned short arr_353[]; extern short arr_362[]; extern int arr_518[]; void test() { for (char d = 0; d < 013; d += 4) { for (char e = 0; e < 11; e++) arr_353[e] = var_2 | std::min((long long)7, var_5); for (int f = var_5; f; f += 4) for (short g = var_8; g; g++) arr_362[g] = 0; } for (short h = 5; (short)var_2; h += 5) arr_518[h] = 0; } gcc version 11.0.0 20201126 (beb9afcaf1466996a301c778596c5df209e7913c)
I will have a look.
For the record, started with r11-4921-g86cca5cc14602814.
The issue is t.C:11:24: note: extracting lane for live stmt _201 = (signed short) pretmp_25; where the vectorized def of this out-of-loop definition is in-loop and thus replacing its uses would require a LC-SSA def.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:ebbe3f29518854c36574adbd4fa82fd56fa64056 commit r11-5542-gebbe3f29518854c36574adbd4fa82fd56fa64056 Author: Richard Biener <rguenther@suse.de> Date: Mon Nov 30 13:39:59 2020 +0100 tree-optimization/98064 - fix BB SLP live lane extract wrt LC SSA This avoids breaking LC SSA when SLP codegen pulled an out-of-loop def into a loop when merging with in-loop defs for an external def. 2020-11-30 Richard Biener <rguenther@suse.de> PR tree-optimization/98064 * tree-vect-loop.c (vectorizable_live_operation): Avoid breaking LC SSA for BB vectorization. * g++.dg/vect/pr98064.cc: New testcase.
Fixed.