https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127263
--- Comment #3 from Richard Biener <rguenth at gcc dot gnu.org> ---
Introduced by
#0 0x0000000001c481ff in replace_ref_with (
stmt=<gimple_assign 0x7ffff69d1a50>,
new_tree=<ssa_name 0x7ffff6609318 14>, set=true, in_lhs=true)
at /space/rguenther/src/gcc-clean/gcc/tree-predcom.cc:1733
#1 0x0000000001c4998e in execute_load_motion (loop=0x7ffff6805640,
chain=0x57c79f0, tmp_vars=0x7fffffffd6c0)
at /space/rguenther/src/gcc-clean/gcc/tree-predcom.cc:2217
#2 0x0000000001c4a103 in pcom_worker::execute_pred_commoning (
this=0x7fffffffd840, tmp_vars=0x7fffffffd6c0)
at /space/rguenther/src/gcc-clean/gcc/tree-predcom.cc:2459
#3 0x0000000001c4c878 in pcom_worker::tree_predictive_commoning_loop (
this=0x7fffffffd840, allow_unroll_p=false)
at /space/rguenther/src/gcc-clean/gcc/tree-predcom.cc:3489
and pointer <-> function-pointer conversion isn't useless in both
directions.
The issue is in execute_load_motion/replace_ref_with which, when
replacing the LHS of a stmt, always use the same variable to
allocate SSA names from. A simple fix is exempt for replace_ref_with
having a special case for replacing the LHS of a clobber by creating
a default def (which requires a VAR_DECL still).
The LHS types should be always preserved.