diff mbox

[fortran,pr65548,addendum,5/6,Regression] gfc_conv_procedure_call

Message ID 20150526190153.5bb6689a@vepi2
State New
Headers show

Commit Message

Andre Vehreschild May 26, 2015, 5:01 p.m. UTC
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 <vehre@gmx.de> wrote:

> Hi all,
> 
> Mikael, thanks for the review. Committed as r223445 (without the else-branch).
> 
> Regards,
> 	Andre

Comments

Thomas Koenig May 27, 2015, 6:38 a.m. UTC | #1
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
Andre Vehreschild May 27, 2015, 8:50 a.m. UTC | #2
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 mbox

Patch

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