Message ID | 20150526190153.5bb6689a@vepi2 |
---|---|
State | New |
Headers | show |
Hi Andre,
> Because this patch is obvious I plan to commit it tomorrow if no one objects?!
The patch itself is obviously OK.
About the test case: In general, it is better not to change existing
test cases unless absolutely necessary (e.g. adjust an error message).
This makes it easier to track regressions.
I would prefer if you made a new test case from your existing one,
with the changes you did and a small explanation of what was
tested in the comments.
If you are worried about runtime for an additonal test, you can use the
! { dg-do run }
hack (notice the two spaces between the dg-do and the run) to have the
test case execute only once.
OK with that change.
Regards
Thomas
Hi Thomas, thanks for the review. Commited as r223738 with the changes (new testcase, double space in dg-do). Regards, Andre On Wed, 27 May 2015 08:38:07 +0200 Thomas Koenig <tkoenig@netcologne.de> wrote: > Hi Andre, > > > Because this patch is obvious I plan to commit it tomorrow if no one > > objects?! > > The patch itself is obviously OK. > > About the test case: In general, it is better not to change existing > test cases unless absolutely necessary (e.g. adjust an error message). > This makes it easier to track regressions. > > I would prefer if you made a new test case from your existing one, > with the changes you did and a small explanation of what was > tested in the comments. > > If you are worried about runtime for an additonal test, you can use the > > ! { dg-do run } > > hack (notice the two spaces between the dg-do and the run) to have the > test case execute only once. > > OK with that change. > > Regards > > Thomas >
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