diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-01-09 17:47:04 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2010-01-09 17:47:04 +0000 |
commit | f2ff577a338d9422ee2b35786b3ae873aab933fe (patch) | |
tree | faf22ebd02e6d70418500dc89807d3068c3b0ad2 /gcc/fortran/expr.c | |
parent | 7c0281633fd3af8f287b51f89906ce3d528216d1 (diff) | |
download | gcc-f2ff577a338d9422ee2b35786b3ae873aab933fe.zip gcc-f2ff577a338d9422ee2b35786b3ae873aab933fe.tar.gz gcc-f2ff577a338d9422ee2b35786b3ae873aab933fe.tar.bz2 |
re PR fortran/20923 (gfortran slow for large array constructors)
2010-01-09 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/20923
PR fortran/32489
* trans-array.c (gfc_conv_array_initializer): Change call to
gfc_error_now to call to gfc_fatal_error.
* array.c (count_elements): Whitespace. (extract_element): Whitespace.
(is_constant_element): Changed name from constant_element.
(gfc_constant_ac): Only use expand_construuctor for expression
types of EXPR_ARRAY. If expression type is EXPR_CONSTANT, no need to
call gfc_is_constant_expr.
* expr.c (gfc_reduce_init_expr): Adjust conditionals and delete error
message.
* resolve.c (gfc_is_expandable_expr): New function that determiners if
array expressions should have their constructors expanded.
(gfc_resolve_expr): Use new function to determine whether or not to call
gfc_expand_constructor.
From-SVN: r155769
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r-- | gcc/fortran/expr.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c index 72420ff..8fa46d8 100644 --- a/gcc/fortran/expr.c +++ b/gcc/fortran/expr.c @@ -2460,18 +2460,12 @@ gfc_reduce_init_expr (gfc_expr *expr) if (t == FAILURE) return FAILURE; - if (expr->expr_type == EXPR_ARRAY - && (gfc_check_constructor_type (expr) == FAILURE - || gfc_expand_constructor (expr) == FAILURE)) - return FAILURE; - - /* Not all inquiry functions are simplified to constant expressions - so it is necessary to call check_inquiry again. */ - if (!gfc_is_constant_expr (expr) && check_inquiry (expr, 1) != MATCH_YES - && !gfc_in_match_data ()) + if (expr->expr_type == EXPR_ARRAY) { - gfc_error ("Initialization expression didn't reduce %C"); - return FAILURE; + if (gfc_check_constructor_type (expr) == FAILURE) + return FAILURE; + if (gfc_expand_constructor (expr) == FAILURE) + return FAILURE; } return SUCCESS; |