diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2009-02-26 06:23:42 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2009-02-26 06:23:42 +0000 |
commit | c1cfed038a9cebb85d49e48958f6021b11372630 (patch) | |
tree | ef4178cf89573e2f854651cfe93d42f398ff80ce /gcc/fortran | |
parent | 1a46aef0bd558a9d767fbaf1fc1aa4878360080a (diff) | |
download | gcc-c1cfed038a9cebb85d49e48958f6021b11372630.zip gcc-c1cfed038a9cebb85d49e48958f6021b11372630.tar.gz gcc-c1cfed038a9cebb85d49e48958f6021b11372630.tar.bz2 |
re PR fortran/39292 (ICE in gfc_conv_array_initializer, at fortran/trans-array.c:3884)
2009-02-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39292
* trans-array.c (gfc_conv_array_initializer): Convert all
expressions rather than ICEing.
2009-02-26 Paul Thomas <pault@gcc.gnu.org>
PR fortran/39292
* gfortran.dg/initialization_22.f90: New test.
From-SVN: r144444
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 15 |
2 files changed, 20 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 57ad11b..48c6c34 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,9 @@ +2009-02-26 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/39292 + * trans-array.c (gfc_conv_array_initializer): Convert all + expressions rather than ICEing. + 2008-02-21 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/38914 diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 2b23f15..6c62350 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -4005,8 +4005,21 @@ gfc_conv_array_initializer (tree type, gfc_expr * expr) CONSTRUCTOR_APPEND_ELT (v, index, se.expr); break; + default: - gcc_unreachable (); + /* Catch those occasional beasts that do not simplify + for one reason or another, assuming that if they are + standard defying the frontend will catch them. */ + gfc_conv_expr (&se, c->expr); + if (range == NULL_TREE) + CONSTRUCTOR_APPEND_ELT (v, index, se.expr); + else + { + if (index != NULL_TREE) + CONSTRUCTOR_APPEND_ELT (v, index, se.expr); + CONSTRUCTOR_APPEND_ELT (v, range, se.expr); + } + break; } } break; |