summaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-11 20:08:54 +0000
committerburnus <burnus@138bc75d-0d04-0410-961f-82ee72b054a4>2011-05-11 20:08:54 +0000
commitd12dee0609604e0a1f5bbbcd62d49e047862d4e5 (patch)
tree99daf63eb676eda68861023c76d9a9abd2e68471 /gcc/fortran/expr.c
parent1752996c9dd7393d6bcac52a8d69dd2538e59dfa (diff)
downloadgcc-d12dee0609604e0a1f5bbbcd62d49e047862d4e5.tar.gz
2011-05-11 Tobias Burnus <burnus@net-b.de>
PR fortran/48889 * expr.c (gfc_is_constant_expr): Use e->value.function.esym instead of e->symtree->n.sym, if available. 2011-05-11 Tobias Burnus <burnus@net-b.de> PR fortran/48889 * gfortran.dg/generic_24.f90: New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173674 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran/expr.c')
-rw-r--r--gcc/fortran/expr.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/gcc/fortran/expr.c b/gcc/fortran/expr.c
index 3d519db4df2..f881bb1dbff 100644
--- a/gcc/fortran/expr.c
+++ b/gcc/fortran/expr.c
@@ -893,6 +893,9 @@ gfc_is_constant_expr (gfc_expr *e)
case EXPR_FUNCTION:
case EXPR_PPC:
case EXPR_COMPCALL:
+ gcc_assert (e->symtree || e->value.function.esym
+ || e->value.function.isym);
+
/* Call to intrinsic with at least one argument. */
if (e->value.function.isym && e->value.function.actual)
{
@@ -901,13 +904,14 @@ gfc_is_constant_expr (gfc_expr *e)
return 0;
}
- /* Make sure we have a symbol. */
- gcc_assert (e->symtree);
-
- sym = e->symtree->n.sym;
-
/* Specification functions are constant. */
/* F95, 7.1.6.2; F2003, 7.1.7 */
+ sym = NULL;
+ if (e->symtree)
+ sym = e->symtree->n.sym;
+ if (e->value.function.esym)
+ sym = e->value.function.esym;
+
if (sym
&& sym->attr.function
&& sym->attr.pure