Commit e3f9e757 by Thomas Koenig

re PR fortran/60834 ([OOP] ICE with ASSOCIATE construct…

re PR fortran/60834 ([OOP] ICE with ASSOCIATE  construct (gimplify_var_or_parm_decl, at gimplify.c:1721))

2014-05-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60834
	* frontend-passes.c (in_assoc_list):  New variable.
	(optimize_namespace):  Initialize in_assoc_list
	(combine_array_constructor): Don't try to combine
	assoc lists.
	(gfc_code_walker):  Keep track of in_assoc_list.

2014-05-12  Thomas Koenig  <tkoenig@gcc.gnu.org>

	PR fortran/60834
	* gfortran.dg/associate_16.f90:  New test.

From-SVN: r210329
parent bc51de9c
2014-05-12 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60834
* frontend-passes.c (in_assoc_list): New variable.
(optimize_namespace): Initialize in_assoc_list
(combine_array_constructor): Don't try to combine
assoc lists.
(gfc_code_walker): Keep track of in_assoc_list.
2014-05-11 Jakub Jelinek <jakub@redhat.com> 2014-05-11 Jakub Jelinek <jakub@redhat.com>
* gfortran.h (gfc_statement): Add ST_OMP_CANCEL, * gfortran.h (gfc_statement): Add ST_OMP_CANCEL,
......
...@@ -88,6 +88,10 @@ static int doloop_size, doloop_level; ...@@ -88,6 +88,10 @@ static int doloop_size, doloop_level;
struct my_struct *evec; struct my_struct *evec;
/* Keep track of association lists. */
static bool in_assoc_list;
/* Entry point - run all passes for a namespace. */ /* Entry point - run all passes for a namespace. */
void void
...@@ -820,6 +824,7 @@ optimize_namespace (gfc_namespace *ns) ...@@ -820,6 +824,7 @@ optimize_namespace (gfc_namespace *ns)
current_ns = ns; current_ns = ns;
forall_level = 0; forall_level = 0;
iterator_level = 0; iterator_level = 0;
in_assoc_list = false;
in_omp_workshare = false; in_omp_workshare = false;
gfc_code_walker (&ns->code, convert_do_while, dummy_expr_callback, NULL); gfc_code_walker (&ns->code, convert_do_while, dummy_expr_callback, NULL);
...@@ -1054,6 +1059,11 @@ combine_array_constructor (gfc_expr *e) ...@@ -1054,6 +1059,11 @@ combine_array_constructor (gfc_expr *e)
if (e->rank != 1) if (e->rank != 1)
return false; return false;
/* Don't try to combine association lists, this makes no sense
and leads to an ICE. */
if (in_assoc_list)
return false;
op1 = e->value.op.op1; op1 = e->value.op.op1;
op2 = e->value.op.op2; op2 = e->value.op.op2;
...@@ -1940,8 +1950,17 @@ gfc_code_walker (gfc_code **c, walk_code_fn_t codefn, walk_expr_fn_t exprfn, ...@@ -1940,8 +1950,17 @@ gfc_code_walker (gfc_code **c, walk_code_fn_t codefn, walk_expr_fn_t exprfn,
case EXEC_BLOCK: case EXEC_BLOCK:
WALK_SUBCODE (co->ext.block.ns->code); WALK_SUBCODE (co->ext.block.ns->code);
for (alist = co->ext.block.assoc; alist; alist = alist->next) if (co->ext.block.assoc)
WALK_SUBEXPR (alist->target); {
bool saved_in_assoc_list = in_assoc_list;
in_assoc_list = true;
for (alist = co->ext.block.assoc; alist; alist = alist->next)
WALK_SUBEXPR (alist->target);
in_assoc_list = saved_in_assoc_list;
}
break; break;
case EXEC_DO: case EXEC_DO:
......
2014-05-12 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/60834
* gfortran.dg/associate_16.f90: New test.
2014-05-12 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com> 2014-05-12 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR target/60991 PR target/60991
......
! { dg-do compile }
! PR 60834 - this used to ICE.
module m
implicit none
type :: t
real :: diffusion=1.
end type
contains
subroutine solve(this, x)
class(t), intent(in) :: this
real, intent(in) :: x(:)
integer :: i
integer, parameter :: n(1:5)=[(i,i=1, 5)]
associate( nu=>this%diffusion)
associate( exponential=>exp(-(x(i)-n) ))
do i = 1, size(x)
end do
end associate
end associate
end subroutine solve
end module m
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment