diff mbox

[testsuite] Use logical_op_short_circuit to skip targets in ssa-thread-14.c.

Message ID A614194ED15B4844BC4C9FB7F21FCD9270454D54@hhmail02.hh.imgtec.org
State New
Headers show

Commit Message

Toma Tabacu Feb. 23, 2017, 11:04 a.m. UTC
Hi,

The ssa-thread-14.c test has been failing for MIPS for a while.

According to Patrick Palka, who modified this test's target selector in the fix
for PR71314, this test fails on targets which don't use non-short-circuit
logical ops and should be skipped for such targets.
In the case of MIPS, LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0, so the test
should be skipped for MIPS targets.

This patch adds the !logical_op_short_circuit requirement (defined in
testsuite/lib/target-supports.exp:7965) to ssa-thread-14.c's dg-options, which
will exclude MIPS targets. It also removes the "-mbranch-cost" options from
being passed to targets which will be skipped because of the newly added
!logical_op_short_circuit requirement.

This makes ssa-thread-14.c's target selector more similar the one from
ssa-thread-11.c (which was mentioned as a solution to PR71314 in the Bugzilla
thread).

Here are some links, for your convenience:
PR71314 on Bugzilla:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71314
The patch submission for fixing PR71314:
https://gcc.gnu.org/ml/gcc-patches/2016-05/msg02359.html

Does this look OK ?
Is the !logical_op_short_circuit too heavy-handed here ?

Regards,
Toma Tabacu

gcc/testsuite/

	* gcc.dg/tree-ssa/ssa-thread-14.c (dg-options): Use
	logical_op_short_circuit to skip targets.
	(dg-additional-options): Don't pass -mbranch-cost=2 for MIPS, AVR
	and s390.

Comments

Jeff Law Feb. 23, 2017, 9:57 p.m. UTC | #1
On 02/23/2017 04:04 AM, Toma Tabacu wrote:
> Hi,
>
> The ssa-thread-14.c test has been failing for MIPS for a while.
>
> According to Patrick Palka, who modified this test's target selector in the fix
> for PR71314, this test fails on targets which don't use non-short-circuit
> logical ops and should be skipped for such targets.
> In the case of MIPS, LOGICAL_OP_NON_SHORT_CIRCUIT is set to 0, so the test
> should be skipped for MIPS targets.
>
> This patch adds the !logical_op_short_circuit requirement (defined in
> testsuite/lib/target-supports.exp:7965) to ssa-thread-14.c's dg-options, which
> will exclude MIPS targets. It also removes the "-mbranch-cost" options from
> being passed to targets which will be skipped because of the newly added
> !logical_op_short_circuit requirement.
>
> This makes ssa-thread-14.c's target selector more similar the one from
> ssa-thread-11.c (which was mentioned as a solution to PR71314 in the Bugzilla
> thread).
>
> Here are some links, for your convenience:
> PR71314 on Bugzilla:
> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71314
> The patch submission for fixing PR71314:
> https://gcc.gnu.org/ml/gcc-patches/2016-05/msg02359.html
>
> Does this look OK ?
> Is the !logical_op_short_circuit too heavy-handed here ?
>
> Regards,
> Toma Tabacu
>
> gcc/testsuite/
>
> 	* gcc.dg/tree-ssa/ssa-thread-14.c (dg-options): Use
> 	logical_op_short_circuit to skip targets.
> 	(dg-additional-options): Don't pass -mbranch-cost=2 for MIPS, AVR
> 	and s390.
I don't think using !logical_op_short_circuit is too heavy handed here.

We get good coverage from the x86 target, so I don't mind losing 
coverage from avr/s390 as the target selector is a lot more likely to be 
correct after your change for the various targets now and in the future.

OK for the trunk.

Thanks,

jeff
Toma Tabacu Feb. 24, 2017, 11:07 a.m. UTC | #2
> From: Jeff Law
> 
> I don't think using !logical_op_short_circuit is too heavy handed here.
> 
> We get good coverage from the x86 target, so I don't mind losing
> coverage from avr/s390 as the target selector is a lot more likely to be
> correct after your change for the various targets now and in the future.
> 
> OK for the trunk.
> 
> Thanks,
> 
> jeff
> 

Thank you for the prompt review.
Committed as r245711.

Regards,
Toma
diff mbox

Patch

diff --git a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c
index c754b5b..aa1323a 100644
--- a/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c
+++ b/gcc/testsuite/gcc.dg/tree-ssa/ssa-thread-14.c
@@ -1,6 +1,6 @@ 
-/* { dg-do compile { target { ! { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-* } } } }  */
+/* { dg-do compile { target { ! { logical_op_short_circuit || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* hppa*-*-* nios2*-*-* } } } } }  */
 /* { dg-additional-options "-O2 -fdump-tree-vrp-details" }  */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* s390*-*-* i?86-*-* x86_64-*-* } }  */
+/* { dg-additional-options "-mbranch-cost=2" { target i?86-*-* x86_64-*-* } }  */
 /* { dg-final { scan-tree-dump-times "Threaded jump" 8 "vrp1" } }  */
 
 void foo (void);