[Aarch64,PR,target/79924] Cannot translate diagnostics

Message ID 1515714296.8647.7.camel@cavium.com
State New
Headers show
Series
  • [Aarch64,PR,target/79924] Cannot translate diagnostics
Related show

Commit Message

Steve Ellcey Jan. 11, 2018, 11:44 p.m.
This is a patch for PR target/79924, which says the error messages
called from aarch64_err_no_fpadvsimd cannot be translated due to
how they are constructed.  To make them translatable and not change
the actual messages would have required creating 16 individual messages
which seemed a bit excessive so I simplified them a bit and fixed
up the test cases that scan for them.

Instead of having 16 messages with:

['-mgeneral-regs-only'|'+nofp' feature modifier] is incompatible with [vector|floating-point] [argument|return type|varargs|code]

I changed it to four messages with

[-mgeneral-regs-only|+nofp feature modifier] is incompatible with the use of [vector|floating point] types

The changes I made in the actual messages were:

Remove the quotes from around '-mgeneral-regs-only' and '+nofp' because error
messages I saw on other platforms did not use quotes around compiler flags.

Replace the specific [argument|return type|varargs|code] terms with
'use of [vector|floating point] types.  This got me from 16 to 4
messages.  I think that since the error message will point at the actual
line where the problem is, having the message be a bit more generic is
not a problem.  Also I chose to include 'the use of' because having these
types (and not doing anything with them) will not trigger one of these
errors only using them in code (as an argument, return type, etc) will
trigger the error.  Also I got rid of the '-' in floating-point since
I didn't see any reason for it to be there.

Tested with no regressions, OK to checkin?

Steve Ellcey
sellcey@cavium.com


2018-01-11  Steve Ellcey  <sellcey@cavium.com>

	PR target/79924
	* config/aarch64/aarch64-protos.h (aarch64_err_no_fpadvsimd): Remove
	second argument.
	* config/aarch64/aarch64-protos..c (aarch64_err_no_fpadvsimd):
	Remove second argument, change how error is called.
	(aarch64_layout_arg): Remove second argument from
	aarch64_err_no_fpadvsimd call.
	(aarch64_init_cumulative_args): Ditto.
	(aarch64_gimplify_va_arg_expr): Ditto.
	* config/aarch64/aarch64.md (mov<mode>): Ditto.


2018-01-11  Steve Ellcey  <sellcey@cavium.com>

	PR target/79924
	* gcc.target/aarch64/mgeneral-regs_1.c: Update error message.
	* gcc.target/aarch64/mgeneral-regs_2.c: Ditto.
	* gcc.target/aarch64/mgeneral-regs_3.c: Ditto.
	* gcc.target/aarch64/nofp_1.c: Ditto.

Patch

diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_1.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_1.c
index 1656db5..9484c8a 100644
--- a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_1.c
@@ -2,8 +2,7 @@ 
 
 typedef int int32x2_t __attribute__ ((__vector_size__ ((8))));
 
-/* { dg-error "'-mgeneral-regs-only' is incompatible with vector return type" "" {target "aarch64*-*-*"} .+2 } */
-/* { dg-error "'-mgeneral-regs-only' is incompatible with vector argument" "" {target "aarch64*-*-*"} .+1 } */
+/* { dg-error "-mgeneral-regs-only is incompatible with the use of vector types" "" {target "aarch64*-*-*"} .+1 } */
 int32x2_t test (int32x2_t a, int32x2_t b)
 {
   return a + b;
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_2.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_2.c
index 8590199..34b4d97 100644
--- a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_2.c
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_2.c
@@ -10,6 +10,6 @@  test (int i, ...)
   va_list argp;
   va_start (argp, i);
   int32x2_t x = (int32x2_t) {0, 1};
-  x += va_arg (argp, int32x2_t); /* { dg-error "'-mgeneral-regs-only' is incompatible with vector varargs" } */
+  x += va_arg (argp, int32x2_t); /* { dg-error "-mgeneral-regs-only is incompatible with the use of vector types" } */
   return x[0] + x[1];
 }
diff --git a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_3.c b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_3.c
index f6b5fba..84320fe 100644
--- a/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_3.c
+++ b/gcc/testsuite/gcc.target/aarch64/mgeneral-regs_3.c
@@ -5,7 +5,7 @@  extern void abort (void);
 int
 test (int i, ...)
 {
-  float f = (float) i; /* { dg-error "'-mgeneral-regs-only' is incompatible with floating-point code" } */
+  float f = (float) i; /* { dg-error "-mgeneral-regs-only is incompatible with the use of floating point types" } */
   if (f != f) abort ();
   return 2;
 }
diff --git a/gcc/testsuite/gcc.target/aarch64/nofp_1.c b/gcc/testsuite/gcc.target/aarch64/nofp_1.c
index 3fc0036..c176c19 100644
--- a/gcc/testsuite/gcc.target/aarch64/nofp_1.c
+++ b/gcc/testsuite/gcc.target/aarch64/nofp_1.c
@@ -15,5 +15,5 @@  main (int argc, char **argv)
 {
   int32x2_t a = (int32x2_t) {0, 1};
   int32x2_t b = (int32x2_t) {2, 3};
-  return test (2, a, b); /* { dg-error "'\\+nofp' feature modifier is incompatible with vector argument" } */
+  return test (2, a, b); /* { dg-error "\\+nofp feature modifier is incompatible with the use of vector types" } */
 }