[LLVMdev] LLVMdev Digest, Vol 76, Issue 43

Duncan Sands baldrick at free.fr
Tue Oct 26 01:00:32 PDT 2010


Hi Kenneth,

> Well...strictly as LLVM IR I find externally visible incorrect behavior
> unlikely, it's just a "different definition".  For C and C++, I'd be
> looking at more complicated variations of
>
> int main()
> {
>      volatile int i = 1;
>      return 0;
> }
>
> It's clear that the LLVM IR representation of i cannot be simply
> IR-volatile qualified, as that load gets optimized out while C and C++
> won't optimize it out.  I'd *hope* that DragonEgg and llvm-gcc both
> leave the load of i in, when in --pedantic mode.  [That is, I expect it
> to take something more intricate than this elementary test case to
> trigger any bugs here.]

both dragonegg and llvm-gcc remove the volatile.  I don't see why they
shouldn't, since the program behaves exactly the same (as far as anyone
external can tell) as if it had been left there.

Ciao,

Duncan.



More information about the llvm-dev mailing list