Bug 38726 - [4.3/4.4 Regression] gfortran.dg/elemental_subroutine_7.f90 fail on Linux/ia64
Summary: [4.3/4.4 Regression] gfortran.dg/elemental_subroutine_7.f90 fail on Linux/ia64
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: 4.4.0
: P3 normal
Target Milestone: 4.4.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-01-05 02:23 UTC by H.J. Lu
Modified: 2009-01-06 13:45 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.3
Known to fail: 4.3.2 4.4.0
Last reconfirmed: 2009-01-05 13:58:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description H.J. Lu 2009-01-05 02:23:24 UTC
On Linux/ia64, revision 143058 gave

FAIL: gfortran.dg/elemental_subroutine_7.f90  -O0  execution test
Comment 1 Dominique d'Humieres 2009-01-05 13:54:14 UTC
The executable aborts on powerpc-apple-darwin9 (r143074) when compiled with -m32, but passes when compiled with -m64.

Comment 2 Dominique d'Humieres 2009-01-05 13:57:22 UTC
See also http://gcc.gnu.org/ml/gcc-testresults/2009-01/msg00421.html for powerpc-apple-darwin8.5.0.

Comment 3 Mikael Morin 2009-01-05 13:58:49 UTC
(In reply to comment #0)
> On Linux/ia64, revision 143058 gave
> 
> FAIL: gfortran.dg/elemental_subroutine_7.f90  -O0  execution test
> 

According to the gcc-testresults mailing list, this is confirmed on powerpc-ibm-aix5.3.0.0, ia64-unknown-linux-gnu, powerpc-apple-darwin8.5.0. 

It's not really a regression though, as I introduced the failing testcase as part of revision 143057.

Please can someone test on older revisions/provide more information?
Without access to such machines, it will be hard to find the culprit. 
Comment 4 Dominique d'Humieres 2009-01-05 14:14:26 UTC
(In reply to comment #3)
> Please can someone test on older revisions/provide more information?

The test passes with gfortran 4.2.3, but not 4.3.2 on powerpc-apple-darwin9. Hence it is a regression.

Comment 5 Thomas Koenig 2009-01-05 14:24:48 UTC
Marking as regression according to Dominique's comment.
Comment 6 Dominique d'Humieres 2009-01-05 14:47:11 UTC
If compiled with -fbounds-check, the executable yields:

At line 29 of file /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
Fortran runtime error: Array reference out of bounds for array 'p', lower bound of dimension 1 exceeded(-2 < 1)

The problem comes from 

...
  p = 20 * r - 10
...
  call tq_tvgh (q(k_lev:), (p(p(k_lev:))))
  if (any (p(p) /= q)) call abort

where min(p)=-10, outside the bounds of p(1:42).

If I use '  p = 41 * r + 1', the test passes.
Comment 7 Mikael Morin 2009-01-05 15:08:39 UTC
(In reply to comment #6)
> If compiled with -fbounds-check, the executable yields:
> 
> At line 29 of file
> /opt/gcc/_gcc_clean/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90
> Fortran runtime error: Array reference out of bounds for array 'p', lower bound
> of dimension 1 exceeded(-2 < 1)
> 
> The problem comes from 
> 
> ...
>   p = 20 * r - 10
> ...
>   call tq_tvgh (q(k_lev:), (p(p(k_lev:))))
>   if (any (p(p) /= q)) call abort
> 
> where min(p)=-10, outside the bounds of p(1:42).
> 
> If I use '  p = 41 * r + 1', the test passes.
> 
Yes, of course. Stupid me.
I started with the random thing, and I added the vector subscript later.
Thanks Dominique.
Comment 8 Mikael Morin 2009-01-05 18:44:28 UTC
Subject: Bug 38726

Author: mikael
Date: Mon Jan  5 18:44:09 2009
New Revision: 143084

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=143084
Log:
2009-01-05  Mikael Morin  <mikael.morin@tele2.fr>

	PR fortran/38669
	PR fortran/38726
	* gfortran.dg/elemental_subroutine_7.f90: 
	Fix p values so that it can be used as vector subscript.


Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/elemental_subroutine_7.f90

Comment 9 Mikael Morin 2009-01-06 13:45:16 UTC
Looks like it's fixed now.
Thanks for the report.
Closing.