<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - fatal error with "-mcmodel=medium -fpic" for global pointers"
href="https://bugs.llvm.org/show_bug.cgi?id=32906">32906</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>fatal error with "-mcmodel=medium -fpic" for global pointers
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>Backend: X86
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>elad2.cohen@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=18399" name="attach_18399" title="Generated .ll file (clang tst.c -S -emit-llvm -mcmodel=medium -fpic">attachment 18399</a> <a href="attachment.cgi?id=18399&action=edit" title="Generated .ll file (clang tst.c -S -emit-llvm -mcmodel=medium -fpic">[details]</a></span>
Generated .ll file (clang tst.c -S -emit-llvm -mcmodel=medium -fpic
The following code crashes when compiling with top-of-trunc clang using
"-mcmodel=medium -fpic":
<span class="quote">> cat tst.c</span >
void foo(int *);
int *x;
int main() {
foo(x);
return 0;
}
<span class="quote">> clang tst.c -c -mcmodel=medium -fpic</span >
fatal error: error in backend: 32 bit reloc applied to a field with a different
size
With gcc this code compiles successfully.
The error is given during assembly:
<span class="quote">> clang tst.c -S -mcmodel=medium -fpic
> clang tst.s</span >
tst.s:19:2: error: 32 bit reloc applied to a field with a different size
movabsq $x@GOTPCREL, %rax
^
Generated .ll and .s files are attached.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>