aarch64: Reword error message for mismatch guard size and probing interval [PR90155]

Message ID 20240213232232.26225-1-quic_apinski@quicinc.com
State Accepted
Headers
Series aarch64: Reword error message for mismatch guard size and probing interval [PR90155] |

Checks

Context Check Description
snail/gcc-patch-check success Github commit url

Commit Message

Andrew Pinski (QUIC) Feb. 13, 2024, 11:22 p.m. UTC
  The error message is not clear what options are being taked about when it says the values
need to match; plus there is a wrong quotation dealing with the diagnostic.
So this changes the error message to be exactly talking about the param options that
are being taked about and now with the options, it needs the quoting.

OK? Built and tested for aarch64-linux-gnu.

gcc/ChangeLog:

	* config/aarch64/aarch64.cc (aarch64_override_options_internal): Fix
	error message for  mismatch guard size and probing interval.

Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
---
 gcc/config/aarch64/aarch64.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
  

Comments

Richard Sandiford Feb. 14, 2024, 9:43 p.m. UTC | #1
Andrew Pinski <quic_apinski@quicinc.com> writes:
> The error message is not clear what options are being taked about when it says the values
> need to match; plus there is a wrong quotation dealing with the diagnostic.
> So this changes the error message to be exactly talking about the param options that
> are being taked about and now with the options, it needs the quoting.
>
> OK? Built and tested for aarch64-linux-gnu.
>
> gcc/ChangeLog:
>
> 	* config/aarch64/aarch64.cc (aarch64_override_options_internal): Fix
> 	error message for  mismatch guard size and probing interval.
>
> Signed-off-by: Andrew Pinski <quic_apinski@quicinc.com>
> ---
>  gcc/config/aarch64/aarch64.cc | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
> index 32eae49d4e9..2da743469ae 100644
> --- a/gcc/config/aarch64/aarch64.cc
> +++ b/gcc/config/aarch64/aarch64.cc
> @@ -18334,7 +18334,7 @@ aarch64_override_options_internal (struct gcc_options *opts)
>  	   "size.  Given value %d (%llu KB) is out of range",
>  	   guard_size, (1ULL << guard_size) / 1024ULL);
>  
> -  /* Enforce that interval is the same size as size so the mid-end does the
> +  /* Enforce that interval is the same size as size so the middle-end does the
>       right thing.  */
>    SET_OPTION_IF_UNSET (opts, &global_options_set,
>  		       param_stack_clash_protection_probe_interval,

Not sure about this.  Aren't both valid?

> @@ -18346,8 +18346,8 @@ aarch64_override_options_internal (struct gcc_options *opts)
>    int probe_interval
>      = param_stack_clash_protection_probe_interval;
>    if (guard_size != probe_interval)
> -    error ("stack clash guard size %<%d%> must be equal to probing interval "
> -	   "%<%d%>", guard_size, probe_interval);
> +    error ("%<--param stack-clash-protection-probe-interval=%d%> needs to match "
> +	   "%<--param stack-clash-protection-guard-size=%d%>", probe_interval, guard_size);

I suppose both versions are still saying something like "4096 must
equal 16384".  So since you've brought up the bike shed, how about:

  "%<--param stack-clash-protection-probe-interval%> value %d does not "
  "match %<--param stack-clash-protection-guard-size%> value %d"

or s/does not match/is not equal to/

OK for this hunk with either of those suggestions if you agree,
but I'm open to other suggestions too...

Thanks,
Richard
  

Patch

diff --git a/gcc/config/aarch64/aarch64.cc b/gcc/config/aarch64/aarch64.cc
index 32eae49d4e9..2da743469ae 100644
--- a/gcc/config/aarch64/aarch64.cc
+++ b/gcc/config/aarch64/aarch64.cc
@@ -18334,7 +18334,7 @@  aarch64_override_options_internal (struct gcc_options *opts)
 	   "size.  Given value %d (%llu KB) is out of range",
 	   guard_size, (1ULL << guard_size) / 1024ULL);
 
-  /* Enforce that interval is the same size as size so the mid-end does the
+  /* Enforce that interval is the same size as size so the middle-end does the
      right thing.  */
   SET_OPTION_IF_UNSET (opts, &global_options_set,
 		       param_stack_clash_protection_probe_interval,
@@ -18346,8 +18346,8 @@  aarch64_override_options_internal (struct gcc_options *opts)
   int probe_interval
     = param_stack_clash_protection_probe_interval;
   if (guard_size != probe_interval)
-    error ("stack clash guard size %<%d%> must be equal to probing interval "
-	   "%<%d%>", guard_size, probe_interval);
+    error ("%<--param stack-clash-protection-probe-interval=%d%> needs to match "
+	   "%<--param stack-clash-protection-guard-size=%d%>", probe_interval, guard_size);
 
   /* Enable sw prefetching at specified optimization level for
      CPUS that have prefetch.  Lower optimization level threshold by 1