[llvm-bugs] [Bug 40236] New: _ARCH_PWR6X defined for incompatible processors
via llvm-bugs
llvm-bugs at lists.llvm.org
Sat Jan 5 21:43:55 PST 2019
https://bugs.llvm.org/show_bug.cgi?id=40236
Bug ID: 40236
Summary: _ARCH_PWR6X defined for incompatible processors
Product: clang
Version: trunk
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P
Component: Frontend
Assignee: unassignedclangbugs at nondot.org
Reporter: hstong at ca.ibm.com
CC: echristo at gmail.com, hfinkel at anl.gov,
kit.barton at gmail.com, llvm-bugs at lists.llvm.org,
neeilans at live.com, nemanja.i.ibm at gmail.com,
richard-llvm at metafoo.co.uk,
wschmidt at linux.vnet.ibm.com
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 (https://github.com/llvm-mirror/clang.git
b4ac732910ee32d004284aaa0632e5bb2fecc5fd)
(https://github.com/llvm-mirror/llvm.git
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
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20190106/60c9d3ac/attachment.html>
More information about the llvm-bugs
mailing list