Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TLS for PowerPC not supported #12965

Closed
ggreif opened this issue Apr 19, 2012 · 4 comments
Closed

TLS for PowerPC not supported #12965

ggreif opened this issue Apr 19, 2012 · 4 comments
Labels
backend:PowerPC bugzilla Issues migrated from bugzilla

Comments

@ggreif
Copy link
Contributor

ggreif commented Apr 19, 2012

Bugzilla Link 12593
Resolution FIXED
Resolved on May 02, 2013 03:37
Version trunk
OS Linux
Attachments C reproduction
CC @zmodem

Extended Description

Small testcase:
(attached)


$ cat tls-test.c
static __thread int sock = -1;

int main(void)
{
return sock;
}

With a PPC-configured Clang I get

$ clang tls-test.c
TLS not implemented for PPC
UNREACHABLE executed at PPCISelLowering.cpp:4562!
0 clang 0x0000000002438fc9
1 clang 0x0000000002438dbc
2 libpthread.so.0 0x000000375a80eb70
3 libc.so.6 0x0000003759c30265 gsignal + 53
4 libc.so.6 0x0000003759c31d10 abort + 272
5 clang 0x00000000024206f1
6 clang 0x0000000001b7ed10 llvm::PPCTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const + 306
7 clang 0x0000000001cbd894
8 clang 0x0000000001cb74d2
9 clang 0x0000000001cdcbf2 llvm::SelectionDAG::Legalize() + 58
10 clang 0x0000000001c71d48 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 2772
11 clang 0x0000000001c70f16 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 258
12 clang 0x0000000001c73cba llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2918
13 clang 0x0000000001c703f8 llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 902

@llvmbot
Copy link
Collaborator

llvmbot commented May 16, 2012

I am working on this:

http://lev.vlakno.cz/~rdivacky/llvm-ppc64-tls.patch

Implementes working local exec TLS

@ggreif
Copy link
Contributor Author

ggreif commented Jun 11, 2012

As of r158307.

Compiling a file with Clang containing a

static __thread int

variable, I get this crash now:

only local-exec TLS mode supported
UNREACHABLE executed at PPCISelLowering.cpp:1244!
0 clang 0x0000000001ad1d8f
1 clang 0x0000000001ad3ff2
2 libpthread.so.0 0x0000003d6220eb70
3 libc.so.6 0x0000003d61630265 gsignal + 53
4 libc.so.6 0x0000003d61631d10 abort + 272
5 clang 0x0000000001aba702 llvm::llvm_unreachable_internal(char const*, char const*, unsigned int) + 354
6 clang 0x000000000134861c
7 clang 0x000000000136ef8e llvm::PPCTargetLowering::LowerOperation(llvm::SDValue, llvm::SelectionDAG&) const + 894
8 clang 0x000000000148493c
9 clang 0x0000000001488ead llvm::SelectionDAG::Legalize() + 269
10 clang 0x0000000001434924 llvm::SelectionDAGISel::CodeGenAndEmitDAG() + 1076
11 clang 0x00000000014358a1 llvm::SelectionDAGISel::SelectBasicBlock(llvm::ilist_iterator<llvm::Instruction const>, llvm::ilist_iterator<llvm::Instruction const>, bool&) + 273
12 clang 0x000000000143793f llvm::SelectionDAGISel::SelectAllBasicBlocks(llvm::Function const&) + 2079
13 clang 0x0000000001438d9f llvm::SelectionDAGISel::runOnMachineFunction(llvm::MachineFunction&) + 1151
14 clang 0x0000000001341a16
15 clang 0x0000000001a2ff0d llvm::FPPassManager::runOnFunction(llvm::Function&) + 557
16 clang 0x0000000001a2fff3 llvm::FPPassManager::runOnModule(llvm::Module&) + 51
17 clang 0x0000000001a308e1 llvm::MPPassManager::runOnModule(llvm::Module&) + 497
18 clang 0x0000000001a30c7b llvm::PassManagerImpl::run(llvm::Module&) + 171
19 clang 0x000000000075ee28 clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::Module*, clang::BackendAction, llvm::raw_ostream*) + 1560
20 clang 0x000000000075c389
21 clang 0x00000000008c3099 clang::ParseAST(clang::Sema&, bool, bool) + 857
22 clang 0x000000000075adb4 clang::CodeGenAction::ExecuteAction() + 68
23 clang 0x0000000000624e41 clang::FrontendAction::Execute() + 145
24 clang 0x0000000000602dd1 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) + 337
25 clang 0x00000000005ec194 clang::ExecuteCompilerInvocation(clang::CompilerInstance*) + 1348
26 clang 0x00000000005e18d8 cc1_main(char const**, char const**, char const*, void*) + 648
27 clang 0x00000000005eb0ae main + 7214
28 libc.so.6 0x0000003d6161d994 __libc_start_main + 244
29 clang 0x00000000005dfef9

Any idea how I can specify that TLS mode, and why does it matter?

@llvmbot
Copy link
Collaborator

llvmbot commented Feb 18, 2013

This is fixed. All TLS modes are supported now.

@ggreif
Copy link
Contributor Author

ggreif commented May 2, 2013

This is fixed. All TLS modes are supported now.

Just a hint, for 32-bit PPC this doesn't seem to work as of r178888. At the moment I cannot try HEAD, but I strongly suspect that this PR has been closed prematurely. (r178888 is well after 2013-02-18)

Just a heads-up :-)

@llvmbot llvmbot transferred this issue from llvm/llvm-bugzilla-archive Dec 3, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend:PowerPC bugzilla Issues migrated from bugzilla
Projects
None yet
Development

No branches or pull requests

2 participants