https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63870
Bug ID: 63870 Summary: [Aarch64] [ARM] Errors in use of NEON instrinsics are reported incorrectly Product: gcc Version: 4.7.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: target Assignee: cbaylis at gcc dot gnu.org Reporter: cbaylis at gcc dot gnu.org CC: alan.lawrence at arm dot com Target: arm-unknown-linux-gnueabi, aarch64-linux-gnu Created attachment 33972 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33972&action=edit Example tests Several NEON intrinsics have arguments which must be a constant integer in a fixed range. At present, these constraints are enforced for most intrinsics during assembly output, or, in some cases, not checked at all. This can be fixed by using the %K format specifier to the error message. See https://gcc.gnu.org/ml/gcc-patches/2014-11/msg01248.html for a proposed patch and explanation. Once that patch is applied, it is necessary to rework the expansion of the builtins so that the constraints are checked during expansion. Some of this work has been started for Aarch64 (https://gcc.gnu.org/ml/gcc-patches/2014-11/msg00421.html) Example demonstration of incorrect error messages using attached test cases on an ARM target. Note that the error message is reported at the end of each function, rather than the line where the error occurs. $ arm-unknown-linux-gnueabihf-gcc -c neon_const_range_tests/* -mfpu=neon neon_const_range_tests/vld1.c: In function ‘f_vld1_lane’: neon_const_range_tests/vld1.c:10:1: error: lane out of range } ^ neon_const_range_tests/vld4.c: In function ‘f_vld4_lane’: neon_const_range_tests/vld4.c:10:1: error: lane out of range } ^ neon_const_range_tests/vmul_lane.c: In function ‘f_vmul_lane’: neon_const_range_tests/vmul_lane.c:10:1: error: lane out of range } ^ neon_const_range_tests/vshl.c: In function ‘f_vshl’: neon_const_range_tests/vshl.c:10:1: error: constant out of range } ^ neon_const_range_tests/vshrn_n.c: In function ‘f_vshrn_n’: neon_const_range_tests/vshrn_n.c:10:1: error: constant out of range } ^ neon_const_range_tests/vst1.c: In function ‘f_vst1_lane’: neon_const_range_tests/vst1.c:9:1: error: lane out of range } ^ neon_const_range_tests/vst4.c: In function ‘f_vst4_lane’: neon_const_range_tests/vst4.c:9:1: error: lane out of range } ^