Given the following C++ input: ``` struct ControlClass { virtual ~ControlClass(); int Width; int Height; unsigned IsToRepaint : 1; }; struct SelectClass : ControlClass { SelectClass(void); }; int Non_Folded_Value(); SelectClass::SelectClass(void) { int factor = Non_Folded_Value(); Width = 32 << factor; Height = 24 << factor; } ``` saved as bug.cpp, and compiling with: > g++-11 -O2 -ftree-vectorize -S bug.cpp results in the following ICE: ``` during GIMPLE pass: ehcleanup bug.cpp: In constructor ‘SelectClass::SelectClass()’: bug.cpp:17:1: internal compiler error: in mark_reachable_handlers, at tree->eh.c:4036 17 | SelectClass::SelectClass(void) | ^~~~~~~~~~~ 0x7f03bd2cd2bc __libc_start_main ???:0 ``` This bug is still present on trunk. It happens even without -ftree-vectorize, but the output is: ``` bug.cpp: In constructor ‘SelectClass::SelectClass()’: bug.cpp:17:1: error: statement marked for throw in middle of block 17 | SelectClass::SelectClass(void) | ^~~~~~~~~~~ # .MEM_8 = VDEF <.MEM_7> _9 = Non_Folded_Value (); during GIMPLE pass: slp bug.cpp:17:1: internal compiler error: verify_gimple failed 0x112f364 verify_gimple_in_cfg(function*, bool) ../../gcc/gcc/tree-cfg.cc:5561 0xfd5eae execute_function_todo ../../gcc/gcc/passes.cc:2085 0xfd6932 execute_todo ../../gcc/gcc/passes.cc:2139 ``` I tracked this issue back to commit 9e5508c2d006f2d4f8670e6c3fed770ac1c85e64: "refactor SLP constant insertion and provde entry insert helper", but simple `git revert` doesn't work as one of the files seems to have been deleted/moved. GCC-10 and older are unaffected. (tested until gcc 7.5.0)
I will have a look.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:3a3eda000fdf4f8754c9a2535191091f1db0c2a2 commit r13-66-g3a3eda000fdf4f8754c9a2535191091f1db0c2a2 Author: Richard Biener <rguenther@suse.de> Date: Mon May 2 09:30:27 2022 +0200 tree-optimization/105437 - BB vect with extern defs of throwing stmts We have to watch out for vectorized stmt insert locations if the def from the last stmt alters control flow. We constrain region building so we know the def is outside of the current region and thus we can insert at the region start point. 2022-05-02 Richard Biener <rguenther@suse.de> PR tree-optimization/105437 * tree-vect-slp.cc (vect_schedule_slp_node): Handle the case where last_stmt alters control flow. * g++.dg/vect/pr105437.cc: New testcase.
Fixed on trunk sofar.
The releases/gcc-12 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:30b5b785abfff334bb50d7fd2051e991324f051f commit r12-8342-g30b5b785abfff334bb50d7fd2051e991324f051f Author: Richard Biener <rguenther@suse.de> Date: Mon May 2 09:30:27 2022 +0200 tree-optimization/105437 - BB vect with extern defs of throwing stmts We have to watch out for vectorized stmt insert locations if the def from the last stmt alters control flow. We constrain region building so we know the def is outside of the current region and thus we can insert at the region start point. 2022-05-02 Richard Biener <rguenther@suse.de> PR tree-optimization/105437 * tree-vect-slp.cc (vect_schedule_slp_node): Handle the case where last_stmt alters control flow. * g++.dg/vect/pr105437.cc: New testcase. (cherry picked from commit 3a3eda000fdf4f8754c9a2535191091f1db0c2a2)
The releases/gcc-11 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:462e7e2c6fe0bc57e03110d43a2c7e53a1ce04ea commit r11-10045-g462e7e2c6fe0bc57e03110d43a2c7e53a1ce04ea Author: Richard Biener <rguenther@suse.de> Date: Mon May 2 09:30:27 2022 +0200 tree-optimization/105437 - BB vect with extern defs of throwing stmts We have to watch out for vectorized stmt insert locations if the def from the last stmt alters control flow. We constrain region building so we know the def is outside of the current region and thus we can insert at the region start point. 2022-05-02 Richard Biener <rguenther@suse.de> PR tree-optimization/105437 * tree-vect-slp.c (vect_schedule_slp_node): Handle the case where last_stmt alters control flow. * g++.dg/vect/pr105437.cc: New testcase. (cherry picked from commit 3a3eda000fdf4f8754c9a2535191091f1db0c2a2)
Fixed.
The master branch has been updated by Jerry DeLisle <jvdelisle@gcc.gnu.org>: https://gcc.gnu.org/g:0c179654c3170749f3fb3232f2442fcbc99bffbb commit r14-9432-g0c179654c3170749f3fb3232f2442fcbc99bffbb Author: Jerry DeLisle <jvdelisle@gcc.gnu.org> Date: Mon Mar 11 15:15:34 2024 -0700 libgfortran: [PR114304] Revert portion of PR105347 change. PR libfortran/105437 PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Remove check for decimal point mode and semicolon used as a seprator. Removes the regression. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Add additional checks to address the case of semicolon at the end of a line.
The releases/gcc-13 branch has been updated by Jerry DeLisle <jvdelisle@gcc.gnu.org>: https://gcc.gnu.org/g:824a71f609b37a8121793075b175e2bbe14fdb82 commit r13-8417-g824a71f609b37a8121793075b175e2bbe14fdb82 Author: Jerry DeLisle <jvdelisle@gcc.gnu.org> Date: Mon Mar 11 15:15:34 2024 -0700 libgfortran: [PR114304] Revert portion of PR105347 change. PR libfortran/105437 PR libfortran/114304 libgfortran/ChangeLog: * io/list_read.c (eat_separator): Remove check for decimal point mode and semicolon used as a seprator. Removes the regression. gcc/testsuite/ChangeLog: * gfortran.dg/pr105473.f90: Add additional checks to address the case of semicolon at the end of a line. (cherry picked from commit 0c179654c3170749f3fb3232f2442fcbc99bffbb)