[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
This commit is contained in:
Alan Lawrence 2014-12-09 20:08:39 +00:00 committed by Alan Lawrence
parent d1e5f2c7e2
commit fca051af18
4 changed files with 18 additions and 5 deletions

View File

@ -1,3 +1,8 @@
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc/config/aarch64-builtins.c (aarch64_simd_expand_args): Update error
message for SIMD_ARG_CONSTANT.
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* config/aarch64/aarch64-builtins.c (aarch64_types_binopv_qualifiers,

View File

@ -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 %<const int%>", opc + 1);
error ("%Kargument %d must be a constant immediate",
exp, opc + 1 - have_retval);
return const0_rtx;
}
break;

View File

@ -1,3 +1,8 @@
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/arg-type-diagnostics-1.c: Call intrinsic, update
expected error message.
2014-12-09 Alan Lawrence <alan.lawrence@arm.com>
* gcc.target/aarch64/simd/vset_lane_s16_const_1.c: New test.

View File

@ -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 } */
}