[committed] testsuite: Ignore warning for unsupported option

Message ID 20231114200014.2394259-1-dimitar@dinux.eu
State Unresolved
Headers
Series [committed] testsuite: Ignore warning for unsupported option |

Checks

Context Check Description
snail/gcc-patch-check warning Git am fail log

Commit Message

Dimitar Dimitrov Nov. 14, 2023, 8 p.m. UTC
  The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the
'-fprefetch-loop-arrays' option is not supported by target.

When commit r14-5380-g5c432b0efab54e removed the -w option, some targets
(arm-none-eabi, pru and possibly others) started failing the test:

  cc1: warning: '-fprefetch-loop-arrays' not supported for this target
  FAIL: gcc.dg/20020206-1.c (test for excess errors)

Fix by instructing DejaGnu to prune the '-fprefetch-loop-arrays'
warning.

Pushed to trunk as an obvious fix.

gcc/testsuite/ChangeLog:

	* gcc.dg/20020206-1.c: Prune warning that
	-fprefetch-loop-arrays is not supported.

CC: Florian Weimer <fweimer@redhat.com>
Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>
---
 gcc/testsuite/gcc.dg/20020206-1.c | 1 +
 1 file changed, 1 insertion(+)
  

Comments

Hans-Peter Nilsson Nov. 14, 2023, 8:23 p.m. UTC | #1
> From: Dimitar Dimitrov <dimitar@dinux.eu>
> Date: Tue, 14 Nov 2023 22:00:14 +0200

> The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the
> '-fprefetch-loop-arrays' option is not supported by target.
> 
> When commit r14-5380-g5c432b0efab54e removed the -w option, some targets
> (arm-none-eabi, pru and possibly others) started failing the test:

(FWIW, all targets that don't implement and enable a
"prefetch" insn pattern.)

>   cc1: warning: '-fprefetch-loop-arrays' not supported for this target
>   FAIL: gcc.dg/20020206-1.c (test for excess errors)
> 
> Fix by instructing DejaGnu to prune the '-fprefetch-loop-arrays'
> warning.
> 
> Pushed to trunk as an obvious fix.

Another obvious fix would be to reinstate the removed -w (as
it remains on other tests passing -fprefetch-loop-arrays).

A fix I now don't have to commit, so thanks!

A much less obvious but IMHO also valid fix, would be to
remove the warning (but then for all users), as the option
is not documented to emit a warning and it appears there are
no tests for the warning.  The documentation says "If
supported by the target machine, generate instructions to
prefetch memory" with no further description on specifics of
what happens when it's not supported.  But, such a change
can always have non-obvious fallout.

brgds, H-P
  
Florian Weimer Nov. 14, 2023, 9:08 p.m. UTC | #2
* Dimitar Dimitrov:

> The -w option was used in gcc.dg/20020206-1.c to ignore warnings if the
> '-fprefetch-loop-arrays' option is not supported by target.
>
> When commit r14-5380-g5c432b0efab54e removed the -w option, some targets
> (arm-none-eabi, pru and possibly others) started failing the test:
>
>   cc1: warning: '-fprefetch-loop-arrays' not supported for this target
>   FAIL: gcc.dg/20020206-1.c (test for excess errors)
>
> Fix by instructing DejaGnu to prune the '-fprefetch-loop-arrays'
> warning.
>
> Pushed to trunk as an obvious fix.
>
> gcc/testsuite/ChangeLog:
>
> 	* gcc.dg/20020206-1.c: Prune warning that
> 	-fprefetch-loop-arrays is not supported.
>
> CC: Florian Weimer <fweimer@redhat.com>
> Signed-off-by: Dimitar Dimitrov <dimitar@dinux.eu>

Ack, makes sense, thanks.

Florian
  

Patch

diff --git a/gcc/testsuite/gcc.dg/20020206-1.c b/gcc/testsuite/gcc.dg/20020206-1.c
index c8d8b61937a..a5a9cb038e7 100644
--- a/gcc/testsuite/gcc.dg/20020206-1.c
+++ b/gcc/testsuite/gcc.dg/20020206-1.c
@@ -5,6 +5,7 @@ 
 /* { dg-do run } */
 /* { dg-options "-O2 -fprefetch-loop-arrays" } */
 /* { dg-options "-O2 -fprefetch-loop-arrays -mtune=pentium3" { target { { i?86-*-* x86_64-*-* } && ia32 } } } */
+/* { dg-prune-output  ".-fprefetch-loop-arrays. not supported for this target" } */
 
 
 struct reload