prevent jump threading from merging blocks when their address is
authorChris Lattner <sabre@nondot.org>
Fri, 18 Feb 2011 04:43:06 +0000 (04:43 +0000)
committerChris Lattner <sabre@nondot.org>
Fri, 18 Feb 2011 04:43:06 +0000 (04:43 +0000)
commit78f7a25f9826ba66610b5bca83ebea71793abf59
treea081b6180cddd66932f73da6dc34fc673193a5f0
parent13fb0db0c26ec498cf8ffb0f9943d28962d4ced7
prevent jump threading from merging blocks when their address is
taken (and used!).  This prevents merging the blocks (invalidating
the block addresses) in a case like this:

#define _THIS_IP_  ({ __label__ __here; __here: (unsigned long)&&__here; })

void foo() {
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
  printf("%p\n", _THIS_IP_);
}

which fixes PR4151.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125829 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Transforms/Scalar/JumpThreading.cpp
test/Transforms/JumpThreading/indirectbr.ll