[LLVMdev] Bug Report -- Possible optimizer bug with thread_local variables

Tom Bergan tbergan at cs.washington.edu
Fri Nov 9 17:59:25 PST 2012


Submitted as http://llvm.org/bugs/show_bug.cgi?id=14309

On Fri, Nov 9, 2012 at 5:34 PM, Hans Wennborg <hans at chromium.org> wrote:

> On Fri, Nov 9, 2012 at 4:54 PM, Tom Bergan <tbergan at cs.washington.edu>
> > The bug manifests
> > more simply if the variables "Ptr" and "Foo" are declared static -- in
> this
> > case, the bug is demonstrated directly with "clang -O3".
> >
> > Attached are three files:
> > * test.c, which is the same as the old test.c, but with "Ptr" and "Foo"
> > declared static
> > * test.0.ll, which was built with "clang -emit-llvm -S -O0 test.c -o
> > test.0.ll"
> > * test.3.ll, which was built with "clang -emit-llvm -S -O3 test.c -o
> > test.3.ll"
> >
> > To demonstrate the bug (verified with revision 167568):
> > $ clang -O3 -lpthread test.c -o test
> > $ ./test   # prints "Foo: 0"
> >
> > It is also pretty clear that "test.3.ll" is an incorrect optimization of
> > "test.0.ll"
>
> This looks like a bug indeed. Can you please file it at
> http://llvm.org/bugs/ ?
>
> Thanks,
> Hans
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121109/b487b2ab/attachment.html>


More information about the llvm-dev mailing list