Patchwork [Fortran,committed] Some coarray fixes (PR 18918 and 48477)

login
register
mail settings
Submitter Tobias Burnus
Date April 6, 2011, 6:34 p.m.
Message ID <4D9CB245.7000804@net-b.de>
Download mbox | patch
Permalink /patch/90048/
State New
Headers show

Comments

Tobias Burnus - April 6, 2011, 6:34 p.m.
I have committed the following three rather obvious patches (separately):

1. libgfortran/caf/mpi.c: I am now finally convinced that one indeed 
need to make use of MPI_Initialized's return value when calling 
MPI_Finalize. Thanks to all who pointed it out several times.

2. gcc/fortran/trans-intrinsic.c: Before the patch, the argument-free 
version of this_image() was broken for -fcoarray=lib. This breakage 
proves that one badly needs -fcoarray=lib test cases.

3. gcc/testsuite/gfortran.dg/coarray_13.f90: Reported as PR 48477. It 
make sense to avoid accessing array element 140 of an array which only 
has 3 elements ...

Committed as Revs. 172059, 172060 and 172061.

Tobias

Patch

Index: gcc/testsuite/ChangeLog
===================================================================
--- gcc/testsuite/ChangeLog	(Revision 172058)
+++ gcc/testsuite/ChangeLog	(Arbeitskopie)
@@ -1,3 +1,9 @@ 
+2011-04-06  Tobias Burnus  <burnus@net-b.de>
+
+	PR fortran/18918
+	PR fortran/48477
+	* gfortran.dg/coarray_13.f90: Avoid out-of-bounds access.
+
 2011-04-06  Steve Ellcey  <sje@cup.hp.com>
 
 	* gcc.dg/mtune.c: Prune note from output.
@@ -33,7 +39,7 @@ 
 
 2011-04-04  Yufeng Zhang  <yufeng.zhang@arm.com>
 
-        * g++.dg/abi/arm_cxa_vec1.C (__ARM_EABI__): Fix typo.
+	* g++.dg/abi/arm_cxa_vec1.C (__ARM_EABI__): Fix typo.
 	(cctor): Actually return the value.
 	(main): Cast return values.
 
Index: gcc/testsuite/gfortran.dg/coarray_13.f90
===================================================================
--- gcc/testsuite/gfortran.dg/coarray_13.f90	(Revision 172058)
+++ gcc/testsuite/gfortran.dg/coarray_13.f90	(Arbeitskopie)
@@ -105,10 +105,10 @@  contains
     integer :: n
     integer :: A(-1:3,0:4,-2:5,-4:7)[n+2:n+5,n-1:*]
 
-    A(1,1,1,1) = 42
-    if (A(1,1,1,1) /= 42) call abort()
-    A(1,1,1,1)[4,n] = -42
-    if (A(1,1,1,1)[4,n] /= -42) call abort()
+    A(-1,0,-2,-4) = 42
+    if (A(-1,0,-2,-4) /= 42) call abort()
+    A(1,0,-2,-4) = 99
+    if (A(1,0,-2,-4) /= 99) call abort()
 
     if (this_image(A,dim=1) /= n+2) call abort()
     if (lcobound  (A,dim=1) /= n+2) call abort()