public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "burnus at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/48889] [4.6/4.7 Regression] f951: internal compiler error: in gfc_is_constant_expr, at fortran/expr.c:906
Date: Wed, 11 May 2011 09:23:00 -0000	[thread overview]
Message-ID: <bug-48889-4-CENllkhoU9@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-48889-4@http.gcc.gnu.org/bugzilla/>

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48889

--- Comment #6 from Tobias Burnus <burnus at gcc dot gnu.org> 2011-05-11 08:49:38 UTC ---
Some more debugging: While e->symtree == NULL, the symbols seems to be properly
resolved as e->value.function contains:

(gdb) p e->value.function->name
$11 = 0x2aaaaac273f0 "sparsity_size"
(gdb) p e->value.function->esym->name
$13 = 0x2aaaaac273f0 "sparsity_size"

And that's the proper specific function.


I was actually wondering whether always either isym or esym exists; however, as
gfortran.dg/graphite/id-2.f90 shows, the case that only e->symtree->n.sym is
set also occurs. Draft patch:

--- 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


  parent reply	other threads:[~2011-05-11  8:55 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-05 14:39 [Bug fortran/48889] New: " wence at gmx dot li
2011-05-05 16:29 ` [Bug fortran/48889] " kargl at gcc dot gnu.org
2011-05-07 18:38 ` david.ham at imperial dot ac.uk
2011-05-08 14:14 ` [Bug fortran/48889] [4.6/4.7 Regression] " burnus at gcc dot gnu.org
2011-05-10 12:45 ` burnus at gcc dot gnu.org
2011-05-10 13:52 ` burnus at gcc dot gnu.org
2011-05-11  9:23 ` burnus at gcc dot gnu.org [this message]
2011-05-11  9:51 ` jakub at gcc dot gnu.org
2011-05-11 20:27 ` burnus at gcc dot gnu.org
2011-05-11 20:40 ` burnus at gcc dot gnu.org
2011-05-11 21:04 ` burnus at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-48889-4-CENllkhoU9@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).