On Mon, May 3, 2021 at 5:06 PM Eric Botcazou <botca...@adacore.com> wrote: > > > Hmm, instead of (ab-)using debug_map can we instead use sth like setting > > TREE_VISITED on the argument decl (not the value - it might be passed > > multiple tiimes)? IIRC TREE_VISITED state is undetermined thus we can > > clear it at the start of setup_one_parameter and set it when we want to > > avoid the clobber and then test for this later? > > > > In the end I'd even find using a new bitmap to record parameter decl UIDs > > cleaner ... (I'm not sure if we not end up doing tree walks that might > > clobber TREE_VISITED here). > > I tried TREE_VISITED and other similar kludges but this broke in weird ways so > reusing debug_map was probably the best of them. Less kludgy version attached > though, before switching to a dedicated bitmap indeed.
After simplifying insert_debug_decl_map this much, can you inline it at the single caller? OK with that change. Thanks, Richard. > > * tree-inline.c (insert_debug_decl_map): Insert unconditionally. > (copy_debug_stmt): Minor tweak. > (setup_one_parameter): Do not create a variable if the value is either > a read-only DECL or a non-addressable local variable in the caller. > (expand_call_inline): Do not generate a CLOBBER for these values. > > -- > Eric Botcazou