public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] testsuite/gcc.dg/uninit-pred-9_b.c:20: Fix XPASS for various targets
@ 2023-11-25  3:15 Hans-Peter Nilsson
  2023-11-26 19:59 ` Mike Stump
  0 siblings, 1 reply; 2+ messages in thread
From: Hans-Peter Nilsson @ 2023-11-25  3:15 UTC (permalink / raw)
  To: gcc-patches; +Cc: nickc

While looking at the various targets, I found that the m32r
target has two options implemented as opposites:
-mbranch-cost=1 and -mbranch-cost=2, that have a bug that
makes them yield their functionally opposite effect;
i.e. -mbranch-cost=$arg, arg={1, 2} yields BRANCH_COST(x, y)
3-$arg.  Anyway, the default is 1, unknown if that's
deliberate.  (I won't add a PR, just CC:ing the maintainer.)

Tested for
XPASSing targets: m32r-elf and cris-elf
XFAILing targets: loongarch64-unknown-linux-gnuf64 and ia64-linux.

Ok to commit?

-- >8 --
The xfail for "*-*-*" here, set in r14-4089-gd45ddc2c04e471
"tree-optimization/111294 - backwards threader PHI costing"
was somewhat too general and made this test XPASS for a
number of targets.  The common factor for those targets is
that they either explicitly or by default define
LOGICAL_OP_NON_SHORT_CIRCUIT as 0 (see fold-const.cc).

Instead of changing *-*-* to a seemingly random set of
xfailed targets or inventing a new testsuite
effective-target predicate for logical-op-short-circuited
targets or the opposite, let's just force a setting that
removes the need for the xfail for all targets, by
overriding with --param=logical-op-non-short-circuit=0.

	* gcc.dg/uninit-pred-9_b.c: Remove xfail for line 20.  Pass
	--param=logical-op-non-short-circuit=0.  Comment why.
---
 gcc/testsuite/gcc.dg/uninit-pred-9_b.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/gcc.dg/uninit-pred-9_b.c b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
index 3e544f3f1be4..1877d5d45d6c 100644
--- a/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
+++ b/gcc/testsuite/gcc.dg/uninit-pred-9_b.c
@@ -1,5 +1,6 @@
 /* { dg-do compile } */
-/* { dg-options "-Wuninitialized -O2" } */
+/* The param shuts up a bogus uninitialized warning at line 21.  */
+/* { dg-options "-Wuninitialized -O2 --param=logical-op-non-short-circuit=0" } */
 
 int g;
 void bar();
@@ -17,7 +18,7 @@ int foo (int n, int l, int m, int r)
 
   if (l > 100)
     if ( (n <= 9) &&  (m < 100)  && (r < 19) )
-      blah(v); /* { dg-bogus "uninitialized" "bogus warning" { xfail *-*-* } } */
+      blah(v); /* { dg-bogus "uninitialized" "bogus warning" } */
 
   if ( (n <= 8) &&  (m < 99)  && (r < 19) )
       blah(v); /* { dg-bogus "uninitialized" "pr101674" } */
-- 
2.30.2


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] testsuite/gcc.dg/uninit-pred-9_b.c:20: Fix XPASS for various targets
  2023-11-25  3:15 [PATCH] testsuite/gcc.dg/uninit-pred-9_b.c:20: Fix XPASS for various targets Hans-Peter Nilsson
@ 2023-11-26 19:59 ` Mike Stump
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Stump @ 2023-11-26 19:59 UTC (permalink / raw)
  To: Hans-Peter Nilsson; +Cc: gcc-patches, nickc

On Nov 24, 2023, at 7:15 PM, Hans-Peter Nilsson <hp@axis.com> wrote:
> 
> While looking at the various targets, I found that the m32r
> target has two options implemented as opposites:
> -mbranch-cost=1 and -mbranch-cost=2, that have a bug that
> makes them yield their functionally opposite effect;
> i.e. -mbranch-cost=$arg, arg={1, 2} yields BRANCH_COST(x, y)
> 3-$arg.  Anyway, the default is 1, unknown if that's
> deliberate.  (I won't add a PR, just CC:ing the maintainer.)
> 
> Tested for
> XPASSing targets: m32r-elf and cris-elf
> XFAILing targets: loongarch64-unknown-linux-gnuf64 and ia64-linux.
> 
> Ok to commit?

Ok.

> 	* gcc.dg/uninit-pred-9_b.c: Remove xfail for line 20.  Pass
> 	--param=logical-op-non-short-circuit=0.  Comment why.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-26 19:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-25  3:15 [PATCH] testsuite/gcc.dg/uninit-pred-9_b.c:20: Fix XPASS for various targets Hans-Peter Nilsson
2023-11-26 19:59 ` Mike Stump

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).