Hi!

With some -march=/-mtune= flags even i?86/x86_64 has BRANCH_COST 1 and
various tests fail, furthermore ssa-ifcombine-ccmp* apparently fail on e.g.
s390* or some arm variants.

This patch tries to fix that up.

Bootstrapped/regtested on x86_64-linux and i686-linux, ok for trunk?

2014-03-04  Jakub Jelinek  <ja...@redhat.com>

        PR testsuite/59308
        * gcc.dg/pr46309.c: Don't compile on logical_op_short_circuit targets
        other than mips/avr.  Use -mbranch-cost=2 even for i?86/x86_64.
        * gcc.dg/tree-ssa/reassoc-32.c: Use -mbranch-cost=2 even for
        s390*/i?86/x86_64.
        * gcc.dg/tree-ssa/reassoc-33.c: Likewise.
        * gcc.dg/tree-ssa/reassoc-34.c: Likewise.
        * gcc.dg/tree-ssa/reassoc-35.c: Likewise.
        * gcc.dg/tree-ssa/reassoc-36.c: Likewise.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c: Don't compile on
        logical_op_short_circuit targets other than avr.  Use -mbranch-cost=2
        even for mips*/s390*/i?86/x86_64.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c: Likewise.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c: Likewise.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c: Likewise.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c: Likewise.
        * gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c: Likewise.

--- gcc/testsuite/gcc.dg/pr46309.c.jj   2014-01-10 21:24:11.000000000 +0100
+++ gcc/testsuite/gcc.dg/pr46309.c      2014-03-04 12:02:00.258512491 +0100
@@ -1,10 +1,10 @@
 /* PR tree-optimization/46309 */
-/* { dg-do compile { target { ! { cris*-*-* } } } } */
+/* { dg-do compile { target { { ! logical_op_short_circuit } || { mips*-*-* 
avr*-*-* } } } } */
 /* { dg-options "-O2 -fdump-tree-reassoc-details" } */
 /* The transformation depends on BRANCH_COST being greater than 1
    (see the notes in the PR), so try to force that.  */
 /* { dg-additional-options "-mtune=octeon2" { target mips*-*-* } } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* s390*-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target avr*-*-* s390*-*-* 
i?86-*-* x86_64-*-* } } */
 
 int
 f1 (int a)
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c.jj       2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-32.c  2014-03-04 11:47:17.010524086 
+0100
@@ -1,7 +1,7 @@
 /* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* 
picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* 
xtensa*-*-*"} } } */
 
 /* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 
 int test (int a, int b, int c)
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c.jj       2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-33.c  2014-03-04 11:47:22.440492832 
+0100
@@ -1,7 +1,7 @@
 /* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* 
picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* 
xtensa*-*-* hppa*-*-*"} } } */
 
 /* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int test (int a, int b, int c)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c.jj       2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-34.c  2014-03-04 11:47:32.345438791 
+0100
@@ -1,7 +1,7 @@
 /* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* 
picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* 
xtensa*-*-* hppa*-*-*"} } } */
 
 /* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int test (int a, int b, int c)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c.jj       2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-35.c  2014-03-04 11:47:37.155409295 
+0100
@@ -1,7 +1,7 @@
 /* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* 
picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* 
xtensa*-*-* hppa*-*-*"} } } */
 
 /* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int test (unsigned int a, int b, int c)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c.jj       2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/reassoc-36.c  2014-03-04 11:47:43.193374228 
+0100
@@ -1,7 +1,7 @@
 /* { dg-do run { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* 
picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* 
xtensa*-*-* hppa*-*-*"} } } */
 
 /* { dg-options "-O2 -fno-inline -fdump-tree-reassoc1-details" } */
-/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int test (int a, int b, int c)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c.jj     2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-1.c        2014-03-04 
12:04:04.105804312 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c.jj     2013-11-12 
11:31:19.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-2.c        2014-03-04 
12:04:25.243683589 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c.jj     2013-11-12 
11:31:19.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-3.c        2014-03-04 
12:04:28.345667172 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c.jj     2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-4.c        2014-03-04 
12:04:31.490650180 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c.jj     2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-5.c        2014-03-04 
12:04:35.078630019 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b, int c)
 {
--- gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c.jj     2014-01-08 
23:32:20.000000000 +0100
+++ gcc/testsuite/gcc.dg/tree-ssa/ssa-ifcombine-ccmp-6.c        2014-03-04 
12:04:38.344610528 +0100
@@ -1,7 +1,7 @@
-/* { dg-do compile { target { ! "m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* 
v850*-*-* picochip*-*-* moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* 
powerpc*-*-* xtensa*-*-* arc*-*-* mips*-*-*"} } } */
+/* { dg-do compile { target { ! { { logical_op_short_circuit && { ! avr-*-* } 
} || { m68k*-*-* mmix*-*-* mep*-*-* bfin*-*-* v850*-*-* picochip*-*-* 
moxie*-*-* cris*-*-* m32c*-*-* fr30*-*-* mcore*-*-* powerpc*-*-* xtensa*-*-* 
arc*-*-* mips*-*-* } } } } } */
 
 /* { dg-options "-O2 -g -fdump-tree-optimized" } */
-/* { dg-additional-options "-mbranch-cost=2" { target avr-*-* } } */
+/* { dg-additional-options "-mbranch-cost=2" { target mips*-*-* avr-*-* 
s390*-*-* i?86-*-* x86_64-*-* } } */
 
 int t (int a, int b, int c)
 {

        Jakub

Reply via email to