[LLVMdev] Is it an opt bug ?

Duncan Sands baldrick at free.fr
Tue Feb 28 09:04:38 PST 2012


On 28/02/12 17:48, John Regehr wrote:
>> void t2(double *x)
>> {
>>       long long a[2];
>>       a[0] = 3;
>>       a[1] = 5;
>>       *x = * ((double *) a);
>>       *(x+1) = * ((double *) &a[a[0]-2]);
>> }
>
> Doesn't this code violate the strict aliasing rules?

Maybe, but the LLVM IR he showed seems perfectly well defined.

Ciao, Duncan.



More information about the llvm-dev mailing list