https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93385
--- Comment #19 from Richard Biener <rguenth at gcc dot gnu.org> --- (In reply to Martin Jambor from comment #17) > Created attachment 48302 [details] > Untested fix > > I'm playing with this - only very mildly tested - fix. Ugh. I was thinking of altering the parameter setup for cloning/inlining so that it maps a removed parameter [SSA_NAME] not to a new uninitialized variable/default-def but to error_mark_node and then either scanning the function for those, propagating & DCEing on the fly, or, during cloning/inlining seed a worklist whenever we map something to error_mark_node. The advantage is that we're leaving the IL in a clearly invalid state in case one of those slips through and that the call case you handle should handle itself by followup IPA transforms. Another option is to track a set of removed SSA names in the original and whenever we encounter an original stmt using that during the copying operation elide the copy or transform it. IIRC there's already a stmt transform hook for IPA that could eventually be used for this approach\ (the modify_gimple_stmt hook), but it alreayd gets the copied stmts so all defs have been cloned and the safety the error_mark_node approach would bring is lost.