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: unassignedclangb...@nondot.org
          Reporter: alexander.gr...@tu-dresden.de
                CC: craig.top...@gmail.com, llvm-bugs@lists.llvm.org,
                    richard-l...@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.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to