================
@@ -0,0 +1,133 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py 
UTC_ARGS: --version 6
+; Test that BasicAA conservatively returns MayAlias for local allocas in
+; functions containing returns_twice calls (e.g. setjmp/sigsetjmp), to prevent
+; miscompilation via longjmp re-entry paths invisible in the forward CFG.
+;
+; Reproduces: https://github.com/llvm/llvm-project/issues/198967
+;
+; Without the fix, GVN incorrectly concludes that the store through %p_val
+; (which may alias %i via a longjmp re-entry) cannot modify %i, then DSE
+; eliminates the "store i32 13, ptr %i" as dead. The fix makes
+; EarliestEscapeAnalysis conservatively bail out at the point where
+; isNotCapturedBefore would otherwise return true, if the function contains
+; any returns_twice call.
+
+; RUN: opt < %s -aa-pipeline=basic-aa -passes=gvn,dse -S | FileCheck %s
----------------
antoniofrighetto wrote:

Nit: please move this line above the descriptive comment block, immediately 
after NOTE:.

https://github.com/llvm/llvm-project/pull/212297
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to