diff options
author | Tobias Burnus <burnus@net-b.de> | 2011-11-29 10:57:40 +0100 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2011-11-29 10:57:40 +0100 |
commit | e0516b0583fee75e60211cab19f6270eba510846 (patch) | |
tree | 93cae4dfa48822ec55cc80035cf832c0303452b9 /gcc/fortran/check.c | |
parent | 825298c450a51d78c311e1b629c520aa3f1688a6 (diff) | |
download | gcc-e0516b0583fee75e60211cab19f6270eba510846.zip gcc-e0516b0583fee75e60211cab19f6270eba510846.tar.gz gcc-e0516b0583fee75e60211cab19f6270eba510846.tar.bz2 |
re PR fortran/51306 (MOVE_ALLOC: Make more middle end friendlier)
2011-11-29 Tobias Burnus <burnus@net-b.de>
PR fortran/51306
PR fortran/48700
* check.c (gfc_check_move_alloc): Make sure that from/to
are both polymorphic or neither.
* trans-intrinsic.c (conv_intrinsic_move_alloc): Cleanup,
generate inline code.
2011-11-29 Tobias Burnus <burnus@net-b.de>
PR fortran/51306
PR fortran/48700
* gfortran.dg/move_alloc_5.f90: Add dg-error.
* gfortran.dg/select_type_23.f03: Add dg-error.
* gfortran.dg/move_alloc_6.f90: New.
* gfortran.dg/move_alloc_7.f90: New.
From-SVN: r181801
Diffstat (limited to 'gcc/fortran/check.c')
-rw-r--r-- | gcc/fortran/check.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index d9b9a9c..832eb64 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -2691,6 +2691,14 @@ gfc_check_move_alloc (gfc_expr *from, gfc_expr *to) if (same_type_check (to, 1, from, 0) == FAILURE) return FAILURE; + if (to->ts.type != from->ts.type) + { + gfc_error ("The FROM and TO arguments in MOVE_ALLOC call at %L must be " + "either both polymorphic or both nonpolymorphic", + &from->where); + return FAILURE; + } + if (to->rank != from->rank) { gfc_error ("the '%s' and '%s' arguments of '%s' intrinsic at %L must " |