diff options
author | Paul Thomas <pault@gcc.gnu.org> | 2007-05-25 06:34:10 +0000 |
---|---|---|
committer | Paul Thomas <pault@gcc.gnu.org> | 2007-05-25 06:34:10 +0000 |
commit | 36032710357e5af5f3743c46c29c457e2b04ed05 (patch) | |
tree | c4eb7560188e5880308cc156ac189df846efb9da /gcc/fortran | |
parent | 03fd30b180feb36cff3ae49be196c821d14b76c1 (diff) | |
download | gcc-36032710357e5af5f3743c46c29c457e2b04ed05.zip gcc-36032710357e5af5f3743c46c29c457e2b04ed05.tar.gz gcc-36032710357e5af5f3743c46c29c457e2b04ed05.tar.bz2 |
re PR fortran/32047 (ICE (segfault) for pure function without argument)
2007-05-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32047
* trans-expr.c (gfc_apply_interface_mapping_to_expr): Change
order in logic under EXPR_FUNCTION to handle functions with
no arguments.
2007-05-25 Paul Thomas <pault@gcc.gnu.org>
PR fortran/32047
* gfortran.dg/result_in_spec_2.f90: New test.
From-SVN: r125057
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/fortran/trans-expr.c | 10 |
2 files changed, 12 insertions, 5 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index f0275ef..7ceb0ee 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,10 @@ +2007-05-25 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/32047 + * trans-expr.c (gfc_apply_interface_mapping_to_expr): Change + order in logic under EXPR_FUNCTION to handle functions with + no arguments. + 2007-05-23 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR fortran/31716 diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c index 527a44b..e621a6a 100644 --- a/gcc/fortran/trans-expr.c +++ b/gcc/fortran/trans-expr.c @@ -1653,12 +1653,12 @@ gfc_apply_interface_mapping_to_expr (gfc_interface_mapping * mapping, break; case EXPR_FUNCTION: - if (expr->value.function.actual->expr->expr_type == EXPR_VARIABLE - && gfc_apply_interface_mapping_to_expr (mapping, - expr->value.function.actual->expr) - && expr->value.function.esym == NULL + if (expr->value.function.esym == NULL && expr->value.function.isym != NULL - && expr->value.function.isym->generic_id == GFC_ISYM_LEN) + && expr->value.function.isym->generic_id == GFC_ISYM_LEN + && expr->value.function.actual->expr->expr_type == EXPR_VARIABLE + && gfc_apply_interface_mapping_to_expr (mapping, + expr->value.function.actual->expr)) { gfc_expr *new_expr; new_expr = gfc_copy_expr (expr->value.function.actual->expr->ts.cl->length); |