<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 - _ARCH_PWR6X defined for incompatible processors"
   href="https://bugs.llvm.org/show_bug.cgi?id=40236">40236</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>_ARCH_PWR6X defined for incompatible processors
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

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

        <tr>
          <th>Hardware</th>
          <td>All
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>All
          </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>Frontend
          </td>
        </tr>

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

        <tr>
          <th>Reporter</th>
          <td>hstong@ca.ibm.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>echristo@gmail.com, hfinkel@anl.gov, kit.barton@gmail.com, llvm-bugs@lists.llvm.org, neeilans@live.com, nemanja.i.ibm@gmail.com, richard-llvm@metafoo.co.uk, wschmidt@linux.vnet.ibm.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>The predefined macro `_ARCH_PWR6X` is associated with GCC's `-mcpu=power6x`
option. `-mcpu=power6x` enables generation of P6 "raw mode" instructions such
as `mftgpr`; say for,
```
long long f(double x) {
  long long l;
  __builtin_memcpy(&l, &x, sizeof(long long));
  return l;
}
```

In other words, `_ARCH_PWR6X` indicates that "raw mode" instructions are
acceptable.

Since `mftgpr` generates SIGILL on POWER8, etc., defining `_ARCH_PWR6X` for
such targets is incorrect.

### SOURCE (<stdin>):
#ifdef _ARCH_PWR6X
#error
#endif


### COMPILER INVOCATION:
clang -cc1 -triple powerpc64le-unknown-linux-gnu -target-cpu pwr8 -x c -


### COMPILER OUTPUT:
<stdin>:2:2: error:
#error
 ^
1 error generated.


### EXPECTED OUTPUT:
(Clean compile).


### COMPILER VERSION INFO (clang -v):
clang version 8.0.0 (<a href="https://github.com/llvm-mirror/clang.git">https://github.com/llvm-mirror/clang.git</a>
b4ac732910ee32d004284aaa0632e5bb2fecc5fd)
(<a href="https://github.com/llvm-mirror/llvm.git">https://github.com/llvm-mirror/llvm.git</a>
1011e428fd0908dbabe4c6387ef65ba1f92c39a2)
Target: x86_64-unknown-linux-gnu
Thread model: posix
InstalledDir: /opt/wandbox/clang-head/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/6.0.0
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/5.4.0
Candidate multilib: .;@m64
Selected multilib: .;@m64</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>