[LLVMdev] LLVM 2.4 problem? (resend)

Tatu Vaajalahti tatuvaaj at mac.com
Wed Oct 15 02:23:48 PDT 2008

On 15.10.2008, at 3.42, Chris Lattner wrote:

> On Oct 14, 2008, at 12:52 PM, Tatu Vaajalahti wrote:
>> Hi,
>> I don't know enough C to know for certain if this is a programmer or
>> compiler error:
> Hi Tatu,
> With this information it is impossible to tell if it is your fault or
> llvm's fault.  Please file a bug with a testcase that demonstrates the
> problem, thanks!
> -Chris

Hi Chris,

With this program llvm-gcc -O2 optimizes test2 away even though it's  
address is taken in program (gcc-4.2 does not, neither does llvm-gcc  
with -O or -O0):

#include <stdio.h>

static const char test1 = 'x';
static const char test2 = 'x';

int main(int argc, char **argv)
   printf("%p\n", &test1);
   printf("%p\n", &test2);

   return 0;

Tatu Vaajalahti
Tampere, Finland

More information about the llvm-dev mailing list