Bug 35406 - gfortran.dg/ldist-1.f90 and gcc.dg/tree-ssa/ldist-4.c don't work
Summary: gfortran.dg/ldist-1.f90 and gcc.dg/tree-ssa/ldist-4.c don't work
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: testsuite (show other bugs)
Version: 4.4.0
: P3 trivial
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-02-29 15:20 UTC by H.J. Lu
Modified: 2015-02-12 00:28 UTC (History)
7 users (show)

See Also:
Host:
Target: x86_64-unknown-linux-gnu
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-03-10 00:08:32


Attachments
testsuite patch relative to r133207 (425 bytes, patch)
2008-03-14 12:53 UTC, Uroš Bizjak
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2008-02-29 15:20:09 UTC
On Linux/x86-64, I got

FAIL: gfortran.dg/ldist-1.f90  -O  scan-tree-dump-times ldist "distributed: split to 4 loops" 1
FAIL: gcc.dg/tree-ssa/ldist-4.c scan-tree-dump-times ldist "distributed: split to 2 loops" 0
Comment 1 İsmail Dönmez 2008-03-04 17:14:35 UTC
Confirming on i686-apple-darwin9 with m64.
Comment 2 Serge Belyshev 2008-03-06 18:34:20 UTC
Both are testsuite bugs, apparently.

ldist-1.f90 scans for:
! { dg-final { scan-tree-dump-times "distributed: split to 4 loops" 1 "ldist" } }

and the dump output is: "Loop 1 distributed: split to 5 loops."


And ldist-4.c is even xfailed in a weird way:
/* We used to distribute also innermost loops, but these could produce
   too much code in the outer loop, degrading performance of scalar
   code.  So this test is XFAILed because the cost model of the stand
   alone distribution pass has evolved.  */
/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" } } */

and it works now:
FIXME: Loop 1 not distributed: it has more than two basic blocks.
Loop 2 distributed: split to 2 loops.
Comment 3 John David Anglin 2008-03-09 23:47:09 UTC
Also fails on hppa2.0w-hp-hpux11.11.
Comment 4 Jerry DeLisle 2008-03-10 00:08:32 UTC
If it is just the test case I will attempt to fix it.  If anyone else is already doing so, please let me know so I don't waste my time.  :)
Comment 5 Jerry DeLisle 2008-03-14 03:49:12 UTC
Subject: Bug 35406

Author: jvdelisle
Date: Fri Mar 14 03:48:23 2008
New Revision: 133206

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133206
Log:
2008-03-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR fortran/35406
	* gfortran.dg/ldist-1.f90: Update test to check for 5 loops distributed
	instead of 4.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/ldist-1.f90

Comment 6 Jerry DeLisle 2008-03-14 03:50:19 UTC
Closing.  Please reopen if I broke anything.
Comment 7 Jerry DeLisle 2008-03-14 04:04:10 UTC
I forgot the C case with ldist-4.c,  :)
Comment 8 Jerry DeLisle 2008-03-14 05:00:24 UTC
Subject: Bug 35406

Author: jvdelisle
Date: Fri Mar 14 04:59:39 2008
New Revision: 133207

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133207
Log:
2008-03-13  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	PR testsuite/35406
	* gcc.dg/tree-ssa/ldist-4.c: Update expected scan match count from 0
	to 1.

Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c

Comment 9 Jerry DeLisle 2008-03-14 05:06:18 UTC
Closing again.
Comment 10 H.J. Lu 2008-03-14 05:20:57 UTC
The old gcc.dg/tree-ssa/ldist-4.c passed on Linux/ia32 and failed
on Linux/Intel64. Revision 133206 changed it to fail on Linux/ia32
and pass on Linux/Intel64. I think you want "4|5" instead of 4 or
5. The same goes for gcc.dg/tree-ssa/ldist-4.c.
Comment 11 Uroš Bizjak 2008-03-14 06:37:17 UTC
(In reply to comment #10)
> The old gcc.dg/tree-ssa/ldist-4.c passed on Linux/ia32 and failed
> on Linux/Intel64. Revision 133206 changed it to fail on Linux/ia32
> and pass on Linux/Intel64. I think you want "4|5" instead of 4 or
> 5. The same goes for gcc.dg/tree-ssa/ldist-4.c.

Actually, the test produces different results for 32bit vs 64bit targets.
You can see that in addition to x86_64, it also fails for ppc64, I guess that the same way [1].

I think we need:

/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 0 "ldist" { target ilp32 } } } */
/* { dg-final { scan-tree-dump-times "distributed: split to 2 loops" 1 "ldist" { target lp64 } } } */

for ldist-4.c and something similar for fortran test.

[1] http://gcc.gnu.org/ml/gcc-testresults/2008-03/msg01040.html

Comment 12 Hans-Peter Nilsson 2008-03-14 11:28:36 UTC
(In reply to comment #11)

> Actually, the test produces different results for 32bit vs 64bit targets.

Are you sure you don't mean 32 vs 64-bit *hosts*?

My cris-elf (32-bit target) autotester runs on a x86_64 F8, and it tells me that between 133196:133207 these regressions were introduced, coincident with jvdelisle's changes and that there were no non-testsuite changes in this range:
gcc.sum gcc.dg/tree-ssa/ldist-4.c
gfortran.sum gfortran.dg/ldist-1.f90
and gcc.log and fortran.log says:
FAIL: gcc.dg/tree-ssa/ldist-4.c scan-tree-dump-times ldist "distributed: split to 2 loops" 1
FAIL: gfortran.dg/ldist-1.f90  -O  scan-tree-dump-times ldist "distributed: split to 5 loops" 1
Comment 13 Uroš Bizjak 2008-03-14 12:42:30 UTC
(In reply to comment #12)

> > Actually, the test produces different results for 32bit vs 64bit targets.
> 
> Are you sure you don't mean 32 vs 64-bit *hosts*?

Hm, I have to look into my {,-m32} testresults on x86_64 host.

No, looking at [1] I don't think so.

[1] http://gcc.gnu.org/ml/gcc-testresults/2008-03/msg01037.html
Comment 14 Uroš Bizjak 2008-03-14 12:53:25 UTC
Created attachment 15315 [details]
testsuite patch relative to r133207

Proposed patch, relative to r133207.

HP, does this patch solve your problems?
Comment 15 Hans-Peter Nilsson 2008-03-14 13:48:16 UTC
(In reply to comment #14)
> HP, does this patch solve your problems?

Yes it does, thank you.
Comment 16 uros 2008-03-14 14:18:28 UTC
Subject: Bug 35406

Author: uros
Date: Fri Mar 14 14:17:41 2008
New Revision: 133216

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=133216
Log:
	PR testsuite/35406
	* gcc.dg/tree-ssa/ldist-4.c: Update expected scan match
	count from 0 to 1 for lp64 targets.
	* gfortran.dg/ldist-1.f90: Update test to check
	for 5 loops distributed instead of 4 for lp64 targets.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gcc.dg/tree-ssa/ldist-4.c
    trunk/gcc/testsuite/gfortran.dg/ldist-1.f90

Comment 17 Uroš Bizjak 2008-03-14 14:25:32 UTC
Fixed again.
Comment 18 John David Anglin 2008-06-14 18:15:35 UTC
The revised testcase still fails on hppa*-*-* (32-bit).  The dump
contains "Loop 1 distributed: split to 5 loops."
Comment 19 Joseph S. Myers 2008-07-04 19:53:12 UTC
Removing milestone; no indication here that this is a regression.
Comment 20 Jerry DeLisle 2015-02-12 00:28:05 UTC
Closing. Stale