diff mbox series

Fix tree-ssa/phi-opt-11.c on s390x (PR testsuite/85368)

Message ID 20181122195654.GJ11625@tucnak
State New
Headers show
Series Fix tree-ssa/phi-opt-11.c on s390x (PR testsuite/85368) | expand

Commit Message

Jakub Jelinek Nov. 22, 2018, 7:56 p.m. UTC
Hi!

This test apparently FAILs on s390x-linux, which is an effective target of
both logical_op_short_circuit and branch_cost.
The test has
/* { dg-additional-options "-mbranch-cost=2" { target branch_cost } } */
and that option effectively makes the target ! logical_op_short_circuit,
but the effective target just reflects the default setting.  So, I think
it should expect 0 ifs rather than 2 if -mbranch-cost=2 is used and
2 when that option isn't used.

Tested on x86_64-linux (which is a branch_cost but not logical_op_short_circuit
effective target), Andreas, does this fix it on s390x-linux (I've only
looked at the optimized dump using a cross-compiler)?
Ok for trunk?

2018-11-22  Jakub Jelinek  <jakub@redhat.com>

	PR testsuite/85368
	* gcc.dg/tree-ssa/phi-opt-11.c: For branch_cost targets, expect 0 ifs
	rather than 0 or 2 depending on logical_op_short_circuit.


	Jakub

Comments

Andreas Krebbel Nov. 23, 2018, 2:43 p.m. UTC | #1
On 22.11.18 20:56, Jakub Jelinek wrote:
> Hi!
> 
> This test apparently FAILs on s390x-linux, which is an effective target of
> both logical_op_short_circuit and branch_cost.
> The test has
> /* { dg-additional-options "-mbranch-cost=2" { target branch_cost } } */
> and that option effectively makes the target ! logical_op_short_circuit,
> but the effective target just reflects the default setting.  So, I think
> it should expect 0 ifs rather than 2 if -mbranch-cost=2 is used and
> 2 when that option isn't used.
> 
> Tested on x86_64-linux (which is a branch_cost but not logical_op_short_circuit
> effective target), Andreas, does this fix it on s390x-linux (I've only
> looked at the optimized dump using a cross-compiler)?

Yes it does. Thanks for having a look!

Andreas
Jeff Law Nov. 27, 2018, 7:08 a.m. UTC | #2
On 11/22/18 12:56 PM, Jakub Jelinek wrote:
> Hi!
> 
> This test apparently FAILs on s390x-linux, which is an effective target of
> both logical_op_short_circuit and branch_cost.
> The test has
> /* { dg-additional-options "-mbranch-cost=2" { target branch_cost } } */
> and that option effectively makes the target ! logical_op_short_circuit,
> but the effective target just reflects the default setting.  So, I think
> it should expect 0 ifs rather than 2 if -mbranch-cost=2 is used and
> 2 when that option isn't used.
> 
> Tested on x86_64-linux (which is a branch_cost but not logical_op_short_circuit
> effective target), Andreas, does this fix it on s390x-linux (I've only
> looked at the optimized dump using a cross-compiler)?
> Ok for trunk?
> 
> 2018-11-22  Jakub Jelinek  <jakub@redhat.com>
> 
> 	PR testsuite/85368
> 	* gcc.dg/tree-ssa/phi-opt-11.c: For branch_cost targets, expect 0 ifs
> 	rather than 0 or 2 depending on logical_op_short_circuit.
I threw this into my tester and it fixes the test on s390x-linux:

PASS: gcc.dg/tree-ssa/phi-opt-11.c (test for excess errors)
PASS: gcc.dg/tree-ssa/phi-opt-11.c scan-tree-dump-times optimized "if" 0

OK.

jeff
diff mbox series

Patch

--- gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c.jj	2018-01-17 12:03:37.768893116 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/phi-opt-11.c	2018-11-22 16:33:15.541947777 +0100
@@ -23,5 +23,5 @@  int h(int a, int b, int c, int d)
  return a;
 }
 
-/* { dg-final { scan-tree-dump-times "if" 0 "optimized" { target { ! logical_op_short_circuit } } } } */
-/* { dg-final { scan-tree-dump-times "if" 2 "optimized" { target logical_op_short_circuit } } } */
+/* { dg-final { scan-tree-dump-times "if" 0 "optimized" { target { { ! logical_op_short_circuit } || branch_cost } } } } */
+/* { dg-final { scan-tree-dump-times "if" 2 "optimized" { target { logical_op_short_circuit && { ! branch_cost } } } } } */