diff options
author | Tobias Burnus <burnus@net-b.de> | 2012-06-17 21:30:29 +0200 |
---|---|---|
committer | Tobias Burnus <burnus@gcc.gnu.org> | 2012-06-17 21:30:29 +0200 |
commit | 9a575e05242936ce1e72161bfa6e971ca58ab6c1 (patch) | |
tree | 5918eebbddca96a247344076c1a9e19fa2bf3370 /gcc/fortran | |
parent | a20d08fd75709bddf1275ad959d8a8e6e41bcb10 (diff) | |
download | gcc-9a575e05242936ce1e72161bfa6e971ca58ab6c1.zip gcc-9a575e05242936ce1e72161bfa6e971ca58ab6c1.tar.gz gcc-9a575e05242936ce1e72161bfa6e971ca58ab6c1.tar.bz2 |
re PR fortran/53691 (ICE with -Wsurprising in LAPACK 3.4.1 cgbrfsx.f)
2012-06-17 Tobias Burnus <burnus@net-b.de>
PR fortran/53691
PR fortran/53685
* check.c (gfc_calculate_transfer_sizes): Return if
SIZE= is not constant or source-size cannot be determined.
2012-06-17 Tobias Burnus <burnus@net-b.de>
PR fortran/53691
PR fortran/53685
* gfortran.dg/transfer_check_3.f90: New.
From-SVN: r188708
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/check.c | 8 |
2 files changed, 13 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 845a534..a70ed85 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2012-06-17 Tobias Burnus <burnus@net-b.de> + + PR fortran/53691 + PR fortran/53685 + * check.c (gfc_calculate_transfer_sizes): Return if + SIZE= is not constant or source-size cannot be determined. + 2012-06-16 Tobias Burnus <burnus@net-b.de> PR fortran/53642 diff --git a/gcc/fortran/check.c b/gcc/fortran/check.c index 9926f05..9be8f66 100644 --- a/gcc/fortran/check.c +++ b/gcc/fortran/check.c @@ -3986,7 +3986,6 @@ gfc_try gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size, size_t *source_size, size_t *result_size, size_t *result_length_p) - { size_t result_elt_size; mpz_t tmp; @@ -3995,12 +3994,17 @@ gfc_calculate_transfer_sizes (gfc_expr *source, gfc_expr *mold, gfc_expr *size, if (source->expr_type == EXPR_FUNCTION) return FAILURE; - /* Calculate the size of the source. */ + if (size && size->expr_type != EXPR_CONSTANT) + return FAILURE; + + /* Calculate the size of the source. */ if (source->expr_type == EXPR_ARRAY && gfc_array_size (source, &tmp) == FAILURE) return FAILURE; *source_size = gfc_target_expr_size (source); + if (*source_size == 0) + return FAILURE; mold_element = mold->expr_type == EXPR_ARRAY ? gfc_constructor_first (mold->value.constructor)->expr |