Hi all,<div><br></div><div>System: x86-64 ubuntu 11.04</div><div>LLVM: 3.0</div><div>gcc: 4.5.2</div><div><br></div><div>I declare a thread_local global variable and access it in a function in llvm IR.</div><div>for example, </div>

<div><br></div><div>@my_value = linkonce thread_local global %dummy* null</div><div><br></div><div>define void @test1()  {</div><div>entry:</div><div>    %load_my_value = load %dummy** @my_value</div><div>    ....</div><div>

}</div><div> </div><div>After that, I use the following command:</div><div><br></div><div>bash$ llc -relocation-model=pic test.ll</div><div><br></div><div>And I have test.s which is an assembly file. </div><div><br></div>

<div>I tried to build it with gcc, but I have the following warning</div><div><br></div><div>bash$ gcc -c test.s</div><div><div>test.s: Assembler messages:</div><div>test.s:43: Warning: stand-alone `data16' prefix</div>

</div><div><br></div><div>I just wonder why I have data16 instruction in my assembly file.</div><div>(ps. If I build it with "llc test.ll", the assembly file will not have data16 instruction)</div><div><br></div>

<div>I search the llvm project and find some clues in this file: lib/Target/X86/X86MCInstLower.cpp</div><div>static void LowerTlsAddr(...)</div><div>{</div><div>    bool is64Bits = MI.getOpcode() == X86::TLS_addr64;</div>

<div>    ....</div><div><div>    if (is64Bits) {</div><div>        MCInst prefix;</div><div>        prefix.setOpcode(X86::DATA16_PREFIX);</div><div>        ....</div><div>    } </div></div><div>    ....</div><div>}</div>
<div>
<br></div><div>I think it is the logic to generate data16 instruction, but I wonder why gcc report warning. Is it a LLVM's bug?</div><div>Thanks for your time in advance :D</div>