https://gcc.gnu.org/bugzilla/show_bug.cgi?id=102989
--- Comment #94 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <ja...@gcc.gnu.org>: https://gcc.gnu.org/g:8afe9d5d2fdd047cbd4e3531170af6b66d30e74a commit r14-3128-g8afe9d5d2fdd047cbd4e3531170af6b66d30e74a Author: Jakub Jelinek <ja...@redhat.com> Date: Thu Aug 10 17:29:23 2023 +0200 phiopt: Fix phiopt ICE on vops [PR102989] I've ran into ICE on gcc.dg/torture/bitint-42.c with -O1 or -Os when enabling expensive tests, and unfortunately I can't reproduce without _BitInt. The IL before phiopt3 has: <bb 87> [local count: 203190070]: # .MEM_428 = VDEF <.MEM_367> bitint.159 = VIEW_CONVERT_EXPR<unsigned long[8]>(*.LC3); goto <bb 89>; [100.00%] <bb 88> [local count: 203190070]: # .MEM_427 = VDEF <.MEM_367> bitint.159 = VIEW_CONVERT_EXPR<unsigned long[8]>(*.LC4); <bb 89> [local count: 406380139]: # .MEM_368 = PHI <.MEM_428(87), .MEM_427(88)> # VUSE <.MEM_368> _123 = VIEW_CONVERT_EXPR<unsigned long[8]>(r495[i_107].D.2780)[0]; and factor_out_conditional_operation is called on the vop PHI, it sees it has exactly two operands and defining statements of both PHI arguments are converts (VCEs in this case), so it thinks it is a good idea to try to optimize that and while doing that it constructs void type SSA_NAMEs and the like. 2023-08-10 Jakub Jelinek <ja...@redhat.com> PR c/102989 * tree-ssa-phiopt.cc (single_non_singleton_phi_for_edges): Never return virtual phis and return NULL if there is a virtual phi where the arguments from E0 and E1 edges aren't equal.