[patch, fortran] PR20923 gfortran slow for large array constructors
Tobias Burnus
burnus@net-b.de
Thu Dec 10 22:25:00 GMT 2009
Jerry DeLisle wrote:
> This patch cuts the compilation time for some programs with large
> array constructors in half. It does this by traversing the
> constructor and only calling the more complicated expand_constructor
> for expression types that are EXPR_ARRAY.
Nice!
> I tried several ways to avoid the ICE with no avail. I opted to
> change the error to a gfc_fatal_error. If one thinks about it, this
> really is a fatal error.
That's fine.
> Regression tested on x86-64=linux-gnu. OK for trunk? Is this
> sufficient to close the PR or shall I leave it open?
You seem to include an unrelated patch of expr.c. Otherwise, this patch
(trans-array.c, array.c) is OK. Thanks for the patch!
Maybe I have time tomorrow to look at your second patch.
Tobias
> 2009-12-04 Jerry DeLisle <jvdelisle@gcc.gnu.org>
>
> PR fortran/20923
> * trans-array.c (gfc_conv_array_initializer): Change gfc_error_now to
> gfc_fatal_error.
> * array.c (count_elements): Whitespace. (extract_element):
> Whitespace.
> (is_constant_element): Changed name from constant_element.
> (gfc_constant_element): Only use expand_construuctor for expression
> types of EXPR_ARRAY. If expression type is EXPR_CONSTANT, no need to
> call gfc_is_constant_expr.
More information about the Fortran
mailing list