[LLVMdev] Incorrect loop optimization when building the Linux kernel
david.majnemer at gmail.com
Mon Dec 8 09:58:30 PST 2014
On Monday, December 8, 2014, Joerg Sonnenberger <joerg at britannica.bec.de>
> On Mon, Dec 08, 2014 at 02:03:28AM -0800, David Majnemer wrote:
> > Nick, consider:
> > char a;
> > char b;
> > at run-time:
> > (gdb) p &a
> > $1 = (char (*)) 0x60103c
> > (gdb) p &b
> > $2 = (char (*)) 0x60103c
> > Even if this is not safe at the C or C++ level, this comparison could
> > return equal or not equal depending on what the linker chooses to do.
> It is invalid C as is the original code. If you want to play such linker
> games, mark one of the objects involved as weak.
Right, but nothing forbids this comparison at the IR level.
> LLVM Developers mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev