<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 - Segmentation fault using -mcmodel=large -fpic options after r337740"
   href="https://bugs.llvm.org/show_bug.cgi?id=38385">38385</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segmentation fault using -mcmodel=large -fpic options after r337740
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>new-bugs
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>new bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>ilia.taraban@intel.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org
          </td>
        </tr></table>
      <p>
        <div>
        <pre>This test fails with Segmentation fault after r337740:

================= nice.c ==============
int main ()
{
    unsigned int a [100] = {0};
    return 0;
}
=======================================

<span class="quote">>>> clang -v</span >
clang version 7.0.0 (trunk 338366)
Target: x86_64-unknown-linux-gnu
Thread model: posix
...

<span class="quote">>>> clang -O0 -o nice.exe nice.c
>>> nice.exe</span >

<span class="quote">>>> clang -O0  -mcmodel=large -fpic  -o nice.exe nice.c
>>> nice.exe </span >
Segmentation fault (core dumped)

Started failing after 
------------------------------------------------------------------------
r337740 | rnk | 2018-07-23 23:14:35 +0200 (Mon, 23 Jul 2018) | 9 lines

Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code
models"

Don't try to generate large PIC code for non-ELF targets. Neither COFF
nor MachO have relocations for large position independent code, and
users have been using "large PIC" code models to JIT 64-bit code for a
while now. With this change, if they are generating ELF code, their
JITed code will truly be PIC, but if they target MachO or COFF, it will
contain 64-bit immediates that directly reference external symbols. For
a JIT, that's perfectly fine.
------------------------------------------------------------------------</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>