Hit this when building xdvik-22.87.06 with 13.0.1 20230409 w/ checking. ``` x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I./gui -DPS_GS -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include -Wimplicit -Wreturn-type -O2 -pipe -march=native -fdiagnostics-color=always -frecord-gcc-switches -Wreturn-type -ggdb3 -Werror=implicit-function-declaration -Werror=implicit-int -Wformat -Waddress -Warray-bounds -Wfree-nonheap-object -Wimplicit-function-declaration -Wimplicit-int -Wincompatible-pointer-types -Wint-conversion -Wint-to-pointer-cast -Wmain -Wnonnull -Wodr -Wparentheses -Wreturn-type -Wsizeof-pointer-memaccess -Wstrict-aliasing -Wstring-compare -Wuninitialized -Wunused-value -Wvarargs -c -o util.o util.c util.c: In function ‘fork_process’: util.c:988:1: error: returns_twice call is not first in basic block 25 988 | fork_process(const char *proc_name, Boolean redirect_stdout, | ^~~~~~~~~~~~ pid_96 = vfork (); during GIMPLE pass: slp util.c:988:1: internal compiler error: verify_flow_info failed 0x7aa668 verify_flow_info() /usr/src/debug/sys-devel/gcc-13.0.1_pre20230409-r1/gcc-13-20230409/gcc/cfghooks.cc:285 0x151e50d execute_function_todo /usr/src/debug/sys-devel/gcc-13.0.1_pre20230409-r1/gcc-13-20230409/gcc/passes.cc:2110 0x1485fd1 do_per_function /usr/src/debug/sys-devel/gcc-13.0.1_pre20230409-r1/gcc-13-20230409/gcc/passes.cc:1694 0x1485fd1 execute_todo /usr/src/debug/sys-devel/gcc-13.0.1_pre20230409-r1/gcc-13-20230409/gcc/passes.cc:2152 Please submit a full bug report, with preprocessed source (by using -freport-bug). Please include the complete backtrace with any bug report. See <https://bugs.gentoo.org/> for instructions. ```
Created attachment 54826 [details] util.i.orig (unreduced)
Created attachment 54827 [details] util.i (reduced)
Created attachment 54828 [details] util2.i (reduced further, but check)
This might be a dupe of PR108783 or PR109410 but I had to try reduce it to be relatively sure, so may as well file it here for completeness.
(In reply to Sam James from comment #4) > This might be a dupe of PR108783 or PR109410 but I had to try reduce it to > be relatively sure, so may as well file it here for completeness. I thought it was interesting in this case that it happens even without a definition of foo which was the main motivation for bothering here.
Not a dup. Why is SLP emitting a vector construction in BB 2 and not BB 4? (-fno-tree-slp-vectorize disables it): void dummy_write_proc () { + void (*<T24b>) () * vectp.4; + vector(2) long unsigned int * {ref-all} vectp_myproc.3; + long unsigned int _7; + long unsigned int _8; + vector(2) long unsigned int _9; + <bb 2> [local count: 1073741824]: + _7 = VIEW_CONVERT_EXPR<long unsigned int>(dummy_write_proc); + _8 = VIEW_CONVERT_EXPR<long unsigned int>(dummy_write_proc); + _9 = {_8, _7}; # DEBUG BEGIN_STMT foo (); goto <bb 4>; [99.96%] <bb 3> [local count: 429496]: .ABNORMAL_DISPATCHER (0); <bb 4> [local count: 1073312329]: # DEBUG BEGIN_STMT - myproc.write_proc = dummy_write_proc; - myproc.read_proc = dummy_write_proc; + MEM <vector(2) long unsigned int> [(void (*<T24b>) () *)&myproc] = _9; return; }
I will have a look.
*** Bug 109477 has been marked as a duplicate of this bug. ***
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:2d7ad38707e1fd71193d440198cc0726092b9015 commit r13-7144-g2d7ad38707e1fd71193d440198cc0726092b9015 Author: Richard Biener <rguenther@suse.de> Date: Tue Apr 11 16:06:12 2023 +0200 tree-optimization/109469 - SLP with returns-twice region start The following avoids an SLP region starting with a returns-twice call where we cannot insert stmts at the head. PR tree-optimization/109469 * tree-vect-slp.cc (vect_slp_function): Skip region starts with a returns-twice call. * gcc.dg/torture/pr109469.c: New testcase.
Fixed (but latent).
On a 2nd thought I'm going to backport it for 12.3.
The releases/gcc-12 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:9cc16b95d5d63b18cbc0aa780ffb6b460c791351 commit r12-9411-g9cc16b95d5d63b18cbc0aa780ffb6b460c791351 Author: Richard Biener <rguenther@suse.de> Date: Tue Apr 11 16:06:12 2023 +0200 tree-optimization/109469 - SLP with returns-twice region start The following avoids an SLP region starting with a returns-twice call where we cannot insert stmts at the head. PR tree-optimization/109469 * tree-vect-slp.cc (vect_slp_function): Skip region starts with a returns-twice call. * gcc.dg/torture/pr109469.c: New testcase. (cherry picked from commit 2d7ad38707e1fd71193d440198cc0726092b9015)
Fixed.