[LLVMdev] [Propose] Add address-taken bit to GlobalVariable for disambiguation purpose

Shuxin Yang shuxin.llvm at gmail.com
Tue Oct 29 17:29:35 PDT 2013


 >2) is just for being pedantic :-)
>
> One might otherwise argue in this snippet, x apparently does not have 
> its addr taken,
> however, it's illegal to say  that "x" and "*p" don't alias.
>
>
>  volatile static int x;
>    foo(int *p) {
>      x = 1;
>      *p = 2;   // do not modify x
>      x = x + 1;
>    }
>
Oops, lame examples,  change the example bellow. The reasons remain 
unchanged : for pedantic reasons,
you can ignore it:-)

volatile static int x;
    foo(volatile int *p) {
      x = 1;
      *p = 2;   // do not modify x
      x = x + 1;
    }



More information about the llvm-dev mailing list