Hi all, unfortunately introduced the latest optimization for this patch an ICE in pFUnit again. The issue occurs when the -fbounds-check is used while allocating an array of non-polymorphic or intrinsic type. It is caused by the location of the gfc_expr of e3rhs not set which is needed to generate the runtime error messages of the bounds check.
Bootstraps and regtests ok on x86_64-linux-gnu/f21. Because this patch is obvious I plan to commit it tomorrow if no one objects?! Regards, Andre On Wed, 20 May 2015 16:58:19 +0200 Andre Vehreschild <ve...@gmx.de> wrote: > Hi all, > > Mikael, thanks for the review. Committed as r223445 (without the else-branch). > > Regards, > Andre -- Andre Vehreschild * Email: vehre ad gmx dot de
pr65548_6.clog
Description: Binary data
diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 2c0304b..81943b0 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -5362,6 +5362,7 @@ gfc_trans_allocate (gfc_code * code) bug. */ newsym->n.sym->attr.referenced = 1; e3rhs->expr_type = EXPR_VARIABLE; + e3rhs->where = code->expr3->where; /* Set the symbols type, upto it was BT_UNKNOWN. */ newsym->n.sym->ts = e3rhs->ts; /* Check whether the expr3 is array valued. */ diff --git a/gcc/testsuite/gfortran.dg/allocate_with_source_5.f90 b/gcc/testsuite/gfortran.dg/allocate_with_source_5.f90 index 500f0f0..06dfcad 100644 --- a/gcc/testsuite/gfortran.dg/allocate_with_source_5.f90 +++ b/gcc/testsuite/gfortran.dg/allocate_with_source_5.f90 @@ -1,4 +1,5 @@ ! { dg-do run } +! { dg-options "-fbounds-check" } ! ! Contributed by Juergen Reuter ! Check that pr65548 is fixed. @@ -146,7 +147,7 @@ program test if (any(abs(phs%m_in - [42.0, 42.0]) > 1E-6)) call abort() o%n = 2 - allocate (o%val(2,4)) + allocate (o%val(0:1,4)) call o%make() o2%n = 3