diff options
Diffstat (limited to 'gcc/fortran/simplify.c')
-rw-r--r-- | gcc/fortran/simplify.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/gcc/fortran/simplify.c b/gcc/fortran/simplify.c index 942f2ee..6c1f4bd 100644 --- a/gcc/fortran/simplify.c +++ b/gcc/fortran/simplify.c @@ -7383,6 +7383,7 @@ gfc_simplify_sizeof (gfc_expr *x) { gfc_expr *result = NULL; mpz_t array_size; + size_t res_size; if (x->ts.type == BT_CLASS || x->ts.deferred) return NULL; @@ -7398,7 +7399,8 @@ gfc_simplify_sizeof (gfc_expr *x) result = gfc_get_constant_expr (BT_INTEGER, gfc_index_integer_kind, &x->where); - mpz_set_si (result->value.integer, gfc_target_expr_size (x)); + gfc_target_expr_size (x, &res_size); + mpz_set_si (result->value.integer, res_size); return result; } @@ -7412,6 +7414,7 @@ gfc_simplify_storage_size (gfc_expr *x, { gfc_expr *result = NULL; int k; + size_t siz; if (x->ts.type == BT_CLASS || x->ts.deferred) return NULL; @@ -7427,7 +7430,8 @@ gfc_simplify_storage_size (gfc_expr *x, result = gfc_get_constant_expr (BT_INTEGER, k, &x->where); - mpz_set_si (result->value.integer, gfc_element_size (x)); + gfc_element_size (x, &siz); + mpz_set_si (result->value.integer, siz); mpz_mul_ui (result->value.integer, result->value.integer, BITS_PER_UNIT); return range_check (result, "STORAGE_SIZE"); |