[LLVMbugs] [Bug 18521] New: tls related miscompile

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Jan 17 14:06:50 PST 2014


            Bug ID: 18521
           Summary: tls related miscompile
           Product: libraries
           Version: trunk
          Hardware: PC
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: Sparc
          Assignee: unassignedbugs at nondot.org
          Reporter: rdivacky at freebsd.org
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

nova ~/delta-2006.08.03$ cat runetest.c
    typedef struct {
       extern const _RuneLocale _DefaultRuneLocale;
    extern const _RuneLocale *_CurrentRuneLocale;
       extern __thread const _RuneLocale *_ThreadRuneLocale;
    static __inline const _RuneLocale *__getCurrentRuneLocale(void) {
    if (_CurrentRuneLocale)   return _CurrentRuneLocale;
      int main(int argc, char *argv[]) {
            printf("trl: %p", _ThreadRuneLocale);
           printf("crl: %p", (__getCurrentRuneLocale()));
           printf("drl: %p", &_DefaultRuneLocale);
           printf("gcrl: %p", __getCurrentRuneLocale());
nova ~/delta-2006.08.03$ gcc runetest.c && ./a.out
runetest.c: In function 'main':
runetest.c:11: warning: incompatible implicit declaration of built-in function
trl: 0x0crl: 0x200e38drl: 0x200e38gcrl: 0x200e38nova ~/delta-2006.08.03$ 
nova ~/delta-2006.08.03$ ~/llvm/Release+Asserts/bin/clang runetest.c && ./a.out
runetest.c:9:4: warning: control may reach end of non-void function
runetest.c:11:13: warning: implicitly declaring library function 'printf' with
type 'int (const char *, ...)'
            printf("trl: %p", _ThreadRuneLocale);
runetest.c:11:13: note: please include the header <stdio.h> or explicitly
provide a declaration for 'printf'
2 warnings generated.
Segmentation fault (core dumped)

You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140117/4e146073/attachment.html>

More information about the llvm-bugs mailing list