diff options
author | Andrew Pinski <pinskia@physics.uc.edu> | 2005-11-02 21:01:54 +0000 |
---|---|---|
committer | Andrew Pinski <pinskia@gcc.gnu.org> | 2005-11-02 13:01:54 -0800 |
commit | eca18fb4b61a16634e61b7cf281ab65ef3292a74 (patch) | |
tree | 7c218f214ca42e611a74be01c9d0e04bc0df3d72 /gcc/fortran | |
parent | 86414779a6d1a126eca6281af2dffada41e4fab3 (diff) | |
download | gcc-eca18fb4b61a16634e61b7cf281ab65ef3292a74.zip gcc-eca18fb4b61a16634e61b7cf281ab65ef3292a74.tar.gz gcc-eca18fb4b61a16634e61b7cf281ab65ef3292a74.tar.bz2 |
re PR fortran/18157 (ice-on-valid code, pointer to user-defined type, fold-struct.c)
2005-11-02 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/18157
* gfortran.fortran-torture/compile/defined_type_1.f90: New test.
* gfortran.fortran-torture/compile/defined_type_2.f90: New
test.
* gfortran.fortran-torture/compile/defined_type_3.f90:
New test.
2005-11-02 Andrew Pinski <pinskia@physics.uc.edu>
PR fortran/18157
* trans-array.c (gfc_conv_resolve_dependencies): Use the correct
type for the temporary array.
* trans-expr.c (gfc_trans_assignment): Pass lss
instead of lss_section
to gfc_conv_resolve_dependencies to get the
correct type.
From-SVN: r106396
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 10 | ||||
-rw-r--r-- | gcc/fortran/trans-array.c | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 2 |
3 files changed, 16 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index de6fed3..8589e1c 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,13 @@ +2005-11-02 Andrew Pinski <pinskia@physics.uc.edu> + + PR fortran/18157 + * trans-array.c (gfc_conv_resolve_dependencies): Use the correct + type for the temporary array. + * trans-expr.c (gfc_trans_assignment): Pass lss + instead of lss_section + to gfc_conv_resolve_dependencies to get the + correct type. + 2005-11-02 Tobias Schl"uter <tobias.schlueter@physik.uni-muenchen.de> * decl.c (gfc_match_entry): Function entries don't need an argument diff --git a/gcc/fortran/trans-array.c b/gcc/fortran/trans-array.c index 72669f8..20d3c67 100644 --- a/gcc/fortran/trans-array.c +++ b/gcc/fortran/trans-array.c @@ -2542,10 +2542,13 @@ gfc_conv_resolve_dependencies (gfc_loopinfo * loop, gfc_ss * dest, if (nDepend == 1) { + tree base_type = gfc_typenode_for_spec (&dest->expr->ts); + if (GFC_ARRAY_TYPE_P (base_type) + || GFC_DESCRIPTOR_TYPE_P (base_type)) + base_type = gfc_get_element_type (base_type); loop->temp_ss = gfc_get_ss (); loop->temp_ss->type = GFC_SS_TEMP; - loop->temp_ss->data.temp.type = - gfc_get_element_type (TREE_TYPE (dest->data.info.descriptor)); + loop->temp_ss->data.temp.type = base_type; loop->temp_ss->string_length = dest->string_length; loop->temp_ss->data.temp.dimen = loop->dimen; loop->temp_ss->next = gfc_ss_terminator; diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index f911487..a0339af 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -2719,7 +2719,7 @@ gfc_trans_assignment (gfc_expr * expr1, gfc_expr * expr2) /* Calculate the bounds of the scalarization. */ gfc_conv_ss_startstride (&loop); /* Resolve any data dependencies in the statement. */ - gfc_conv_resolve_dependencies (&loop, lss_section, rss); + gfc_conv_resolve_dependencies (&loop, lss, rss); /* Setup the scalarizing loops. */ gfc_conv_loop_setup (&loop); |