> On Mon, Jul 31, 2023 at 7:05 PM Martin Jambor <mjam...@suse.cz> wrote: > > > > Hi, > > > > when IPA-SRA detects whether a parameter passed by reference is > > written to, it does not special case CLOBBERs which means it often > > bails out unnecessarily, especially when dealing with C++ destructors. > > Fixed by the obvious continue in the two relevant loops. > > > > The (slightly) more complex testcases in the PR need surprisingly more > > effort but the simple one can be fixed now easily by this patch and I'll > > work on the others incrementally. > > > > Bootstrapped and currently undergoing testsuite run on x86_64-linux. OK > > if it passes too? > > LGTM, btw - how are the clobbers handled during transform?
Looks good to me too. I was also wondering if we want to preserve something about the clobber. If SRA fully suceeds it would not be needed but if the original location is not fully SRAed we may theoretically lose information. We put additonal clobber after destructor call, so one would need to wrap it in non-dstructor and be sure that ipa-modref understands the clobber in order to obtain a testcase. Honza