https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112488
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Component|ipa |c --- Comment #2 from Richard Biener <rguenth at gcc dot gnu.org> --- We are remapping a TYPE_DECL, but IIRC we do not "gimplify" those, so their TYPE_SIZE and friends are still GENERIC trees, and more importantly _shared_ which means released SSA names can appear there. This happens during remapping BLOCK_VARS, so I think it's probably desired(?) it means the "error" is in clobbering the shared tree here. But unshare_body doesn't look at the BLOCK tree. It ends up at the TYPE_DECL itself via walking the BIND_EXPR_VARS and we are properly gimplifying the TYPE_DECLs sizes, but walk_tree doesn't recurse into types. I'm not sure whether we are expecting a DECL_EXPR for the TYPE_DECL here (but there's explicit code in walk_tree_1 for that). But I'll note the unsharing walker would depend on that. So I think this is a C frontend issue which fails to emit a DECL_EXPR for the typedef.