From: mikael Date: Thu, 3 Nov 2011 23:31:32 +0000 (+0000) Subject: * trans.h (struct gfc_ss): New field nested_ss. X-Git-Url: http://git.sourceforge.jp/view?p=pf3gnuchains%2Fgcc-fork.git;a=commitdiff_plain;h=f53dc1beca14933ff21b68564c9ff4f93eb882ac * trans.h (struct gfc_ss): New field nested_ss. * trans-expr.c (gfc_advance_se_ss_chain): Update assertion. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@180893 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 47c4938f8e0..92be1535b9e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,5 +1,10 @@ 2011-11-03 Mikael Morin + * trans.h (struct gfc_ss): New field nested_ss. + * trans-expr.c (gfc_advance_se_ss_chain): Update assertion. + +2011-11-03 Mikael Morin + * trans-array.c (set_vector_loop_bounds): Loop over the parents. 2011-11-03 Mikael Morin diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 72d35f8de89..4cfdc3e0906 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -92,7 +92,8 @@ gfc_advance_se_ss_chain (gfc_se * se) while (p != NULL) { /* Simple consistency check. */ - gcc_assert (p->parent == NULL || p->parent->ss == p->ss); + gcc_assert (p->parent == NULL || p->parent->ss == p->ss + || p->parent->ss->nested_ss == p->ss); /* If we were in a nested loop, the next scalarized expression can be on the parent ss' next pointer. Thus we should not take the next diff --git a/gcc/fortran/trans.h b/gcc/fortran/trans.h index 53c5ce25fa4..06088797f64 100644 --- a/gcc/fortran/trans.h +++ b/gcc/fortran/trans.h @@ -249,6 +249,11 @@ typedef struct gfc_ss /* Non-null if the ss is part of a nested loop. */ struct gfc_ss *parent; + /* If the evaluation of an expression requires a nested loop (for example + if the sum intrinsic is evaluated inline), this points to the nested + loop's gfc_ss. */ + struct gfc_ss *nested_ss; + /* The loop this gfc_ss is in. */ struct gfc_loopinfo *loop;