aboutsummaryrefslogtreecommitdiff
path: root/gcc/fortran/expr.c
diff options
context:
space:
mode:
authorTobias Burnus <burnus@net-b.de>2011-05-11 22:08:54 +0200
committerTobias Burnus <burnus@gcc.gnu.org>2011-05-11 22:08:54 +0200
commit0126595fee486221f58aa7e5f46064b194337225 (patch)
tree99daf63eb676eda68861023c76d9a9abd2e68471 /gcc/fortran/expr.c
parent8da1c70b570bc423fd2ea011398a69714ecd8b7a (diff)
downloadgcc-0126595fee486221f58aa7e5f46064b194337225.zip
gcc-0126595fee486221f58aa7e5f46064b194337225.tar.gz
gcc-0126595fee486221f58aa7e5f46064b194337225.tar.bz2
re PR fortran/48889 (f951: internal compiler error: in gfc_is_constant_expr, at fortran/expr.c:906)
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. From-SVN: r173674
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 3d519db..f881bb1 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