public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [Committed] S/390: Fix some testsuite fails
@ 2012-01-26 10:05 Andreas Krebbel
  2012-01-26 12:27 ` Jakub Jelinek
  0 siblings, 1 reply; 3+ messages in thread
From: Andreas Krebbel @ 2012-01-26 10:05 UTC (permalink / raw)
  To: gcc-patches

Hi,

I've applied the attached patch to mainline in order to make some
testsuite fails to disappear on s390 and s390x.

gcc.dg/pr46309.c: This testcase depends on branch cost being above 1.
	I've copied the AVR solution and added a -mbranch-cost option
	to the back-end. That's probably quite handy in other
	situations as well.

gcc.dg/pr44194-1.c: On s390 and s390x the ABI requires us to return
	structs always in memory what makes the testcase fail.
	"Fixed" by disabling the testcase on s390 and s390x.

gfortran.dg/reassoc_4.f: For z10 and higher we override
	max-completely-peeled-insns and other parameters in the
	back-end what makes this testcase fail.  The solution is to
	force the value to the default in order to make the testcase
	work with -march=z10 and higher again.

Bye,

-Andreas-

2012-01-26  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* config/s390/s390.h: Make BRANCH_COST an option.
	* config/s390/s390.opt: New option -mbranch-cost.


2012-01-26  Andreas Krebbel  <Andreas.Krebbel@de.ibm.com>

	* gcc.dg/pr46309.c: Set branch-cost to 2 for s390 and s390x.
	* gcc.dg/pr44194-1.c: Disable since s390 returns structs always in
	memory.
	* gfortran.dg/reassoc_4.f: Force max-completely-peeled-insns to
	the default value for s390 and s390x.

---
 gcc/config/s390/s390.h                |    2 !!
 gcc/config/s390/s390.opt              |    6 ++++++
 gcc/testsuite/gcc.dg/pr44194-1.c      |    2 !!
 gcc/testsuite/gcc.dg/pr46309.c        |    2 !!
 gcc/testsuite/gfortran.dg/reassoc_4.f |    1 +
 5 files changed, 7 insertions(+), 6 modifications(!)

Index: gcc/config/s390/s390.h
===================================================================
*** gcc/config/s390/s390.h.orig
--- gcc/config/s390/s390.h
*************** do {									\
*** 722,728 ****
  
  /* A C expression for the cost of a branch instruction.  A value of 1
     is the default; other values are interpreted relative to that.  */
! #define BRANCH_COST(speed_p, predictable_p) 1
  
  /* Nonzero if access to memory by bytes is slow and undesirable.  */
  #define SLOW_BYTE_ACCESS 1
--- 722,728 ----
  
  /* A C expression for the cost of a branch instruction.  A value of 1
     is the default; other values are interpreted relative to that.  */
! #define BRANCH_COST(speed_p, predictable_p) s390_branch_cost
  
  /* Nonzero if access to memory by bytes is slow and undesirable.  */
  #define SLOW_BYTE_ACCESS 1
Index: gcc/config/s390/s390.opt
===================================================================
*** gcc/config/s390/s390.opt.orig
--- gcc/config/s390/s390.opt
*************** Warn if a single function's framesize ex
*** 140,142 ****
--- 140,148 ----
  mzarch
  Target Report RejectNegative Negative(mesa) Mask(ZARCH)
  z/Architecture
+ 
+ mbranch-cost=
+ Target Report Joined RejectNegative UInteger Var(s390_branch_cost) Init(1)
+ Set the branch costs for conditional branch instructions.  Reasonable
+ values are small, non-negative integers.  The default branch cost is
+ 1.
Index: gcc/testsuite/gcc.dg/pr46309.c
===================================================================
*** gcc/testsuite/gcc.dg/pr46309.c.orig
--- gcc/testsuite/gcc.dg/pr46309.c
***************
*** 4,10 ****
  /* 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*-*-* } } */
  
  int
  f1 (int a)
--- 4,10 ----
  /* 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*-*-* } } */
  
  int
  f1 (int a)
Index: gcc/testsuite/gfortran.dg/reassoc_4.f
===================================================================
*** gcc/testsuite/gfortran.dg/reassoc_4.f.orig
--- gcc/testsuite/gfortran.dg/reassoc_4.f
***************
*** 1,6 ****
--- 1,7 ----
  ! { dg-do compile }
  ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" }
  ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peel-times=16" { target spu-*-* } }
+ ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peeled-insns=400" { target s390*-*-* } }
        subroutine anisonl(w,vo,anisox,s,ii1,jj1,weight)
        integer ii1,jj1,i1,iii1,j1,jjj1,k1,l1,m1,n1
        real*8 w(3,3),vo(3,3),anisox(3,3,3,3),s(60,60),weight
Index: gcc/testsuite/gcc.dg/pr44194-1.c
===================================================================
*** gcc/testsuite/gcc.dg/pr44194-1.c.orig
--- gcc/testsuite/gcc.dg/pr44194-1.c
***************
*** 1,4 ****
! /* { dg-do compile { target { { { i?86-*-* x86_64-*-* } && x32 } || lp64 } } } */
  /* { dg-options "-O2 -fdump-rtl-dse1" } */
  /* Restricting to 64-bit targets since 32-bit targets return
     structures in memory.  */
--- 1,4 ----
! /* { dg-do compile { target { { { { i?86-*-* x86_64-*-* } && x32 } || lp64 } && { ! s390*-*-* } } } } */
  /* { dg-options "-O2 -fdump-rtl-dse1" } */
  /* Restricting to 64-bit targets since 32-bit targets return
     structures in memory.  */

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

* Re: [Committed] S/390: Fix some testsuite fails
  2012-01-26 10:05 [Committed] S/390: Fix some testsuite fails Andreas Krebbel
@ 2012-01-26 12:27 ` Jakub Jelinek
  2012-01-26 16:54   ` Andreas Krebbel
  0 siblings, 1 reply; 3+ messages in thread
From: Jakub Jelinek @ 2012-01-26 12:27 UTC (permalink / raw)
  To: Andreas Krebbel; +Cc: gcc-patches

On Thu, Jan 26, 2012 at 11:05:21AM +0100, Andreas Krebbel wrote:
> *** gcc/testsuite/gfortran.dg/reassoc_4.f.orig
> --- gcc/testsuite/gfortran.dg/reassoc_4.f
> ***************
> *** 1,6 ****
> --- 1,7 ----
>   ! { dg-do compile }
>   ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" }
>   ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peel-times=16" { target spu-*-* } }
> + ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peeled-insns=400" { target s390*-*-* } }

Better would be to use dg-additional-options here (both for s390 and spu).

	Jakub

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

* Re: [Committed] S/390: Fix some testsuite fails
  2012-01-26 12:27 ` Jakub Jelinek
@ 2012-01-26 16:54   ` Andreas Krebbel
  0 siblings, 0 replies; 3+ messages in thread
From: Andreas Krebbel @ 2012-01-26 16:54 UTC (permalink / raw)
  To: Jakub Jelinek; +Cc: gcc-patches

On 01/26/2012 01:27 PM, Jakub Jelinek wrote:
> On Thu, Jan 26, 2012 at 11:05:21AM +0100, Andreas Krebbel wrote:
>> *** gcc/testsuite/gfortran.dg/reassoc_4.f.orig
>> --- gcc/testsuite/gfortran.dg/reassoc_4.f
>> ***************
>> *** 1,6 ****
>> --- 1,7 ----
>>   ! { dg-do compile }
>>   ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1" }
>>   ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peel-times=16" { target spu-*-* } }
>> + ! { dg-options "-O3 -ffast-math -fdump-tree-reassoc1 --param max-completely-peeled-insns=400" { target s390*-*-* } }
> 
> Better would be to use dg-additional-options here (both for s390 and spu).

Ok. Fixed.

-Andreas-

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

end of thread, other threads:[~2012-01-26 16:54 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-26 10:05 [Committed] S/390: Fix some testsuite fails Andreas Krebbel
2012-01-26 12:27 ` Jakub Jelinek
2012-01-26 16:54   ` Andreas Krebbel

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).