Bug 36551 - Failure to compile __thread variable.
Summary: Failure to compile __thread variable.
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 4.3.1
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-06-17 13:08 UTC by Carlos O'Donell
Modified: 2008-06-18 02:35 UTC (History)
2 users (show)

See Also:
Host: hppa64-linux-gnu
Target: hppa64-linux-gnu
Build: hppa-linux-gnu
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Carlos O'Donell 2008-06-17 13:08:59 UTC
Steps to reproduce:

cat >> test.c <<EOF
__thread int foo;

void bar (void) {
  foo = 2;
}
EOF

hppa64-linux-gnu-gcc-4.3.1 -S test.c
test.c: In function 'bar':
test.c:5: error: unrecognizable insn:
(insn 6 5 7 3 test.c:4 (set (reg:DI 67)
        (unspec:SI [
                (const_int 0 [0x0])
            ] 3)) -1 (nil))
test.c:5: internal compiler error: in extract_insn, at recog.c:1990
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

Expected:
- Compiler correctly compiles the code.

Observed:
- ICE trying to compile code with __thread keyword.

hppa does have support for thread local storage, but it's never been tested on the 64-bit compiler.

I came across this error while trying to port glibc to hppa64-linux-gnu during a 64-bit userspace bring-up.
Comment 1 dave 2008-06-17 23:42:46 UTC
Subject: Re:   New: Failure to compile __thread variable.

> hppa64-linux-gnu-gcc-4.3.1 -S test.c

There is no TLS support for the 64-bit compiler.  This is an enhancement
request.

Dave
Comment 2 Carlos O'Donell 2008-06-18 02:35:48 UTC
Yes, I just realized there were no TARGET_64BIT TLS patterns in config/pa/pa.md. 

I'm closing the bug as invalid. I'll take this up seperately. We'll have to define call sequences for the 64-bit address loads etcs.