[llvm-bugs] [Bug 46817] New: Vector load operations vec_xl have non-const pointers in their signature
via llvm-bugs
llvm-bugs at lists.llvm.org
Thu Jul 23 05:53:05 PDT 2020
https://bugs.llvm.org/show_bug.cgi?id=46817
Bug ID: 46817
Summary: Vector load operations vec_xl have non-const pointers
in their signature
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: Headers
Assignee: unassignedclangbugs at nondot.org
Reporter: alexander.grund at tu-dresden.de
CC: craig.topper at gmail.com, llvm-bugs at lists.llvm.org,
richard-llvm at metafoo.co.uk
I'm getting failed compilations for code using vec_xl on IBM Power architecture
machines where the input is a `const float*`.
GCC happily accepts the same code but on clang it fails to resolved the
function as the clang vec_xl functions use non-const pointers.
>From a semantic PoV using const pointers is more correct as the value is only
read. Example:
static inline __ATTRS_o_ai vector signed long long
vec_xl(signed long long __offset, signed long long *__ptr) {
return *(unaligned_vec_sll *)(__ptr + __offset);
}
Note that changing to const pointers is backward compatible as they can be
converted from non-const pointers implicitly.
--
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/20200723/400443a1/attachment.html>
More information about the llvm-bugs
mailing list