ahatanak added a comment.
Thank you for the great example! I can now see this patch does fix mis-compiles.
There are probably other lifetime bugs you'll see when the code being compiled
includes gotos that jump past variable declarations, including the one here:
http://lists.llvm.org/pipermail/cfe-dev/2016-July/050066.html. Do you think you
can extend the approach taken in this patch to prevent mis-compiles for those
Also, rather than removing the intrinsics altogether, have you considered
making changes to IRGen to insert them to different locations or insert extra
lifetime.starts? In your example, if I insert lifetime.start for "tmp" at the
beginning of label "l1", it doesn't assert. I made the same changes for the
example I sent to cfe-dev, but it didn't work because DSE removed the store to
"i" (if I disable DSE, I see the expected result).
cfe-commits mailing list