This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, fortran] PRs 19358, 19477, 21211 and 21622 (+15502?)
- From: Tobias Schlüter <tobias dot schlueter at physik dot uni-muenchen dot de>
- To: Paul Thomas <paulthomas2 at wanadoo dot fr>
- Cc: "'fortran at gcc dot gnu dot org'" <fortran at gcc dot gnu dot org>,patch <gcc-patches at gcc dot gnu dot org>,Mark Mitchell <mark at codesourcery dot com>
- Date: Tue, 13 Sep 2005 19:29:25 +0200
- Subject: Re: [Patch, fortran] PRs 19358, 19477, 21211 and 21622 (+15502?)
- References: <432704BD.6060603@wanadoo.fr>
Paul Thomas wrote:
> This patch fixes a type that causes the ICE in the above PRs.
>
> This is not a complete fix because the implicit interface case still
> does not work. However, I decided to submit this because of the
> freezing of 4.0, since it could nearly be committed under the obvious
> rule and because it is the last bug in the SPEC meta-bug PR15502 (I think?).
>
> Regtested on Athlon1700/FC3. OK for mainline and 4.0?
If you're not trying to say that the PRs are in fact not duplicates you should
only add 19358 to the ChangeLog. Apart from this, this is ok, and I agree
that this would usually fall under the obviously correct rule, but you'll need
approval from Mark (whom I've added to CC) for 4.0.
- Tobi
>
> Paul T
>
>
> ------------------------------------------------------------------------
>
> 2005-09-13 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/19358
> PR fortran/19477
> PR fortran/21211
> PR fortran/21622
> * trans-array.c (gfc_trans_dummy_array_bias): correct the typo
> which uses dim[i].upper for lbound, rather than dm[i].lower.
>
> 2005-09-13 Paul Thomas <pault@gcc.gnu.org>
>
> PR fortran/19358
> PR fortran/19477
> PR fortran/21211
> PR fortran/21622
> * gfortran.fortran-torture/execute/assumed_dummy_1.f90: New test.
>
>
> Index: gcc/gcc/fortran/trans-array.c
> ===================================================================
> RCS file: /cvs/gcc/gcc/gcc/fortran/trans-array.c,v
> retrieving revision 1.60
> diff -c -p -r1.60 trans-array.c
> *** gcc/gcc/fortran/trans-array.c 9 Sep 2005 06:34:07 -0000 1.60
> --- gcc/gcc/fortran/trans-array.c 13 Sep 2005 16:48:54 -0000
> *************** gfc_trans_dummy_array_bias (gfc_symbol *
> *** 3477,3483 ****
> if (!INTEGER_CST_P (lbound))
> {
> gfc_init_se (&se, NULL);
> ! gfc_conv_expr_type (&se, sym->as->upper[n],
> gfc_array_index_type);
> gfc_add_block_to_block (&block, &se.pre);
> gfc_add_modify_expr (&block, lbound, se.expr);
> --- 3477,3483 ----
> if (!INTEGER_CST_P (lbound))
> {
> gfc_init_se (&se, NULL);
> ! gfc_conv_expr_type (&se, sym->as->lower[n],
> gfc_array_index_type);
> gfc_add_block_to_block (&block, &se.pre);
> gfc_add_modify_expr (&block, lbound, se.expr);
>
>
> ================assumed_dummy_1.f90==============
>
> ! { dg do-run}
> ! Tests the fix for PRs 19358, 19477, 21211 and 21622.
> !
> ! Note that this tests only the cases with explicit interfaces.
> !
> ! Contributed by Paul Thomas <pault@gcc.gnu.org>
> !
> module global
> contains
> SUBROUTINE goo (x, i)
> REAL, DIMENSION(i:) :: x
> integer :: i
> x (3) = 99.0
> END SUBROUTINE goo
> end module global
>
> SUBROUTINE foo (x, i)
> REAL, DIMENSION(i:) :: x
> integer :: i
> x (4) = 42.0
> END SUBROUTINE foo
>
> program test
> use global
> real, dimension(3) :: y = 0
> integer :: j = 2
>
> interface
> SUBROUTINE foo (x, i)
> REAL, DIMENSION(i:) :: x
> integer :: i
> END SUBROUTINE foo
> end interface
> call foo (y, j)
> call goo (y, j)
> call roo (y, j)
> if (any(y.ne.(/21.0, 99.0, 42.0/))) call abort ()
> contains
> SUBROUTINE roo (x, i)
> REAL, DIMENSION(i:) :: x
> integer :: i
> x (2) = 21.0
> END SUBROUTINE roo
> end program test
>
>
>
>