https://gcc.gnu.org/bugzilla/show_bug.cgi?id=119533
--- Comment #15 from GCC Commits <cvs-commit at gcc dot gnu.org> --- The releases/gcc-14 branch has been updated by Kito Cheng <k...@gcc.gnu.org>: https://gcc.gnu.org/g:e363940e1cef7f6face970414ffaa565daf413bd commit r14-11701-ge363940e1cef7f6face970414ffaa565daf413bd Author: Vineet Gupta <vine...@rivosinc.com> Date: Tue Apr 15 09:29:08 2025 -0700 RISC-V: vsetvl: elide abnormal edges from LCM computations [PR119533] vsetvl phase4 uses LCM guided info to insert VSETVL insns, including a straggler loop for "mising vsetvls" on certain edges. Currently it asserts on encountering EDGE_ABNORMAL. When enabling go frontend with V enabled, libgo build hits the assert. The solution is to prevent abnormal edges from getting into LCM at all (my prior attempt at this just ignored them after LCM which is not right). Existing invalid_opt_bb_p () current does this for BB predecessors but not for successors which is what the patch adds. Crucially, the ICE/fix also depends on avoiding vsetvl hoisting past non-transparent blocks: That is taken care of by Robin's patch "RISC-V: Do not lift up vsetvl into non-transparent blocks [PR119547]" for a different yet related issue. Reported-by: Heinrich Schuchardt <heinrich.schucha...@canonical.com> Signed-off-by: Vineet Gupta <vine...@rivosinc.com> PR target/119533 gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (invalid_opt_bb_p): Check for EDGE_ABNOMAL. (pre_vsetvl::compute_lcm_local_properties): Initialize kill bitmap. Debug dump skipped edge. gcc/testsuite/ChangeLog: * go.dg/pr119533-riscv.go: New test. * go.dg/pr119533-riscv-2.go: New test. (cherry picked from commit edb4867412895100b3addc525bc0dba0ea90c7f9)