public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Mikael Morin <mikael.morin@sfr.fr>
To: Janus Weil <janus@gcc.gnu.org>
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran, OOP] PR 56266: ICE on invalid in gfc_match_varspec
Date: Mon, 15 Apr 2013 22:49:00 -0000	[thread overview]
Message-ID: <516C3AA0.4020302@sfr.fr> (raw)
In-Reply-To: <51697D4A.1060903@sfr.fr>

[-- Attachment #1: Type: text/plain, Size: 191 bytes --]

Le 13/04/2013 17:44, Mikael Morin a écrit :
> Indeed, that's invalid:
> 
And then, the call to gfc_match_varspec shouldn't be there in the first
place.  I'll test the following later.





[-- Attachment #2: remove_match_varspec_call.diff --]
[-- Type: text/plain, Size: 1242 bytes --]

Index: primary.c
===================================================================
--- primary.c	(révision 197949)
+++ primary.c	(copie de travail)
@@ -1954,11 +1954,10 @@ gfc_match_varspec (gfc_expr *primary, int equiv_fl
 
 	  gcc_assert (!tail || !tail->next);
 
-	  if (!(primary->expr_type == EXPR_VARIABLE
-		|| (primary->expr_type == EXPR_STRUCTURE
-		    && primary->symtree && primary->symtree->n.sym
-		    && primary->symtree->n.sym->attr.flavor)))
-	    return MATCH_ERROR;
+	  gcc_assert (primary->expr_type == EXPR_VARIABLE
+		      || (primary->expr_type == EXPR_STRUCTURE
+		          && primary->symtree && primary->symtree->n.sym
+		          && primary->symtree->n.sym->attr.flavor));
 
 	  if (tbp->n.tb->is_generic)
 	    tbp_sym = NULL;
@@ -3102,18 +3101,8 @@ gfc_match_rvalue (gfc_expr **result)
 	gfc_error ("Missing argument list in function '%s' at %C", sym->name);
 
       if (m != MATCH_YES)
-	{
-	  m = MATCH_ERROR;
-	  break;
-	}
+	m = MATCH_ERROR;
 
-      /* If our new function returns a character, array or structure
-	 type, it might have subsequent references.  */
-
-      m = gfc_match_varspec (e, 0, false, true);
-      if (m == MATCH_NO)
-	m = MATCH_YES;
-
       break;
 
     generic_function:


  reply	other threads:[~2013-04-15 17:37 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-12 23:38 Janus Weil
2013-04-13 19:48 ` Mikael Morin
2013-04-14  1:18   ` Janus Weil
2013-04-14  8:42     ` Mikael Morin
2013-04-15 22:49       ` Mikael Morin [this message]
2013-04-15 23:11         ` Janus Weil
2013-04-16 15:07           ` Janus Weil
2013-04-16 16:19             ` Tobias Burnus

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=516C3AA0.4020302@sfr.fr \
    --to=mikael.morin@sfr.fr \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=janus@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).