From fca051af18ffcc9e44763c106e21fe3cf5e0d3ca Mon Sep 17 00:00:00 2001 From: Alan Lawrence Date: Tue, 9 Dec 2014 20:08:39 +0000 Subject: [PATCH] [AArch64]Improve error message for non-constant immediates gcc/: * gcc/config/aarch64-builtins.c (aarch64_simd_expand_args): Update error message for SIMD_ARG_CONSTANT. gcc/testsuite/: * gcc.target/aarch64/arg-type-diagnostics-1.c: Call intrinsic, update expected error message. From-SVN: r218534 --- gcc/ChangeLog | 5 +++++ gcc/config/aarch64/aarch64-builtins.c | 4 ++-- gcc/testsuite/ChangeLog | 5 +++++ .../gcc.target/aarch64/arg-type-diagnostics-1.c | 9 ++++++--- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index d6bb1787332..4ba56768e61 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Alan Lawrence + + * gcc/config/aarch64-builtins.c (aarch64_simd_expand_args): Update error + message for SIMD_ARG_CONSTANT. + 2014-12-09 Alan Lawrence * config/aarch64/aarch64-builtins.c (aarch64_types_binopv_qualifiers, diff --git a/gcc/config/aarch64/aarch64-builtins.c b/gcc/config/aarch64/aarch64-builtins.c index f52f524e55e..e3779a499cb 100644 --- a/gcc/config/aarch64/aarch64-builtins.c +++ b/gcc/config/aarch64/aarch64-builtins.c @@ -926,8 +926,8 @@ aarch64_simd_expand_args (rtx target, int icode, int have_retval, if (!(*insn_data[icode].operand[opc].predicate) (op[opc], mode)) { - error_at (EXPR_LOCATION (exp), "incompatible type for argument %d, " - "expected %", opc + 1); + error ("%Kargument %d must be a constant immediate", + exp, opc + 1 - have_retval); return const0_rtx; } break; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 24822feb409..8e536a42325 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-12-09 Alan Lawrence + + * gcc.target/aarch64/arg-type-diagnostics-1.c: Call intrinsic, update + expected error message. + 2014-12-09 Alan Lawrence * gcc.target/aarch64/simd/vset_lane_s16_const_1.c: New test. diff --git a/gcc/testsuite/gcc.target/aarch64/arg-type-diagnostics-1.c b/gcc/testsuite/gcc.target/aarch64/arg-type-diagnostics-1.c index 55dd9f66f23..a7b7cd3bd8d 100644 --- a/gcc/testsuite/gcc.target/aarch64/arg-type-diagnostics-1.c +++ b/gcc/testsuite/gcc.target/aarch64/arg-type-diagnostics-1.c @@ -3,13 +3,16 @@ #include "arm_neon.h" -void foo () +void foo (int a) { - int a; int32x2_t arg1; int32x2_t arg2; int32x2_t result; arg1 = vcreate_s32 (UINT64_C (0x0000ffffffffffff)); arg2 = vcreate_s32 (UINT64_C (0x16497fffffffffff)); - result = __builtin_aarch64_srsra_nv2si (arg1, arg2, a); /* { dg-error "incompatible type for argument" } */ + /* The correct line number is in the preamble to the error message, + not in the final line (which is all that dg-error inspects). Hence, + we have to tell dg-error to ignore the line number. */ + result = vrsra_n_s32 (arg1, arg2, a); + /* { dg-error "must be a constant immediate" "" { target *-*-* } 0 } */ } -- 2.30.2