On Wed, Feb 02, 2022 at 03:42:48PM +0100, Richard Biener via Gcc-patches wrote: > This adds a flag to CONSTRUCTOR nodes indicating that for > clobbers this marks the end-of-life of storage as opposed to > just ending the lifetime of the object that occupied it. > The dangling pointer diagnostics uses CLOBBERs but is confused > by those emitted by the C++ frontend for example which emits > them for the second purpose at the start of CTORs. The issue > is also appearant for aarch64 in PR104092.
I think many further build_clobber calls actually should build those EOL clobbers, I think we'd need to go through them one by one and see what kind of clobber it is. E.g. I think all of omp-low.cc build_clobber calls are like that. C++ FE indeed emits some clobbers at the start of ctors with -flifetime-dse=2, but others e.g. at the end of dtors, dunno about those, though maybe the object doesn't go out of scope at that point yet. What about expansion and tree-ssa-live.cc, should those keep doing what it does and not ignore clobbers that aren't CLOBBER_MARKS_EOL? Jakub