Affects versions down to at least r5 : (compiles with "(_Complex a)" instead) $ cat z1.c void h (); void f () __attribute__ ((returns_twice)); void g (_Complex int a) { f (); if (a != 0) { a = 0; h (); } } $ gcc-11-20201115 -c z1.c during RTL pass: expand z1.c: In function 'g': z1.c:3:6: internal compiler error: tree check: expected ssa_name, have integer_cst in compute_optimized_partition_bases, at tree-ssa-coalesce.c:1638 3 | void g (_Complex int a) | ^ 0x626df8 tree_check_failed(tree_node const*, char const*, int, char const*, ...) ../../gcc/tree.c:9779 0xe4bb1f tree_check(tree_node*, char const*, int, char const*, tree_code) ../../gcc/tree.h:3314 0xe4bb1f compute_optimized_partition_bases ../../gcc/tree-ssa-coalesce.c:1638 0xe4bb1f coalesce_ssa_name(_var_map*) ../../gcc/tree-ssa-coalesce.c:1718 0xdde89b remove_ssa_form ../../gcc/tree-outof-ssa.c:1065 0xdde89b rewrite_out_of_ssa(ssaexpand*) ../../gcc/tree-outof-ssa.c:1323 0x80fa70 execute ../../gcc/cfgexpand.c:6407
Mine. We may not have constants in abnormal edge PHI arguments.
The master branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:0d8290959ecf2c5f1dd062e57782b5e91be0f8f6 commit r11-5156-g0d8290959ecf2c5f1dd062e57782b5e91be0f8f6 Author: Richard Biener <rguenther@suse.de> Date: Thu Nov 19 09:06:50 2020 +0100 tree-optimization/97897 - complex lowering on abnormal edges This fixes complex lowering to not put constants into abnormal edge PHI values by making sure abnormally used SSA names are VARYING in its propagation lattice. 2020-11-19 Richard Biener <rguenther@suse.de> PR tree-optimization/97897 * tree-complex.c (complex_propagate::visit_stmt): Make sure abnormally used SSA names are VARYING. (complex_propagate::visit_phi): Likewise. * tree-ssa.c (verify_phi_args): Verify PHI arguments on abnormal edges are SSA names. * gcc.dg/pr97897.c: New testcase.
Fixed on trunk sofar.
The releases/gcc-10 branch has been updated by Richard Biener <rguenth@gcc.gnu.org>: https://gcc.gnu.org/g:9272936ac5fac472a3690145572afa6ed19eaa8e commit r10-9405-g9272936ac5fac472a3690145572afa6ed19eaa8e Author: Richard Biener <rguenther@suse.de> Date: Thu Nov 19 09:06:50 2020 +0100 tree-optimization/97897 - complex lowering on abnormal edges This fixes complex lowering to not put constants into abnormal edge PHI values by making sure abnormally used SSA names are VARYING in its propagation lattice. 2020-11-19 Richard Biener <rguenther@suse.de> PR tree-optimization/97897 * tree-complex.c (complex_propagate::visit_stmt): Make sure abnormally used SSA names are VARYING. (complex_propagate::visit_phi): Likewise. * gcc.dg/pr97897.c: New testcase.
Fixed. Not planning to backport further.