public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
To: Mikael Morin <mikael.morin@sfr.fr>
Cc: fortran@gcc.gnu.org, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] fortran/67758 -- Prevent ICE caused by misplaced COMMON
Date: Fri, 02 Oct 2015 16:44:00 -0000	[thread overview]
Message-ID: <20151002164442.GB12835@troutmask.apl.washington.edu> (raw)
In-Reply-To: <560E4E26.6000302@sfr.fr>

On Fri, Oct 02, 2015 at 11:28:06AM +0200, Mikael Morin wrote:
> Le 01/10/2015 18:30, Steve Kargl a écrit :
> > I'm fine with your patch, although I find the error message
> > to be somewhat confusing as no procedure appears in COMMON.
> 
> Well, XX is implicitly a procedure.
> 

Yes, I understamf what gfortran is doing.  However, I
less fluent Fortran programmer who expects XX to be 
an array may be confused by error message.

> > The call-stmt in the code is the start of an execution-construct.
> > A common-stmt is not allowed in an execution-construct.  At
> > least, that's how I intepret the BNF in 2.1 of F2008.
> >
> The error message appears too soon, before we finish parsing the common 
> statement.  If it's delayed, as with the following additional patch, the 
> common statements is properly rejected:
> 
> common_24.f:10:72:
> 
>         COMMON /FMCOM / XX(80 000 000) ! { dg-error "conflicts with 
> COMMON" }
>                                                                          1
> Error: Unexpected COMMON statement at (1)
> common_24.f:8:72:
> 
> Error: PROCEDURE attribute conflicts with COMMON attribute in ???xx??? at (1)
> 
> This needs a little more polishing (location missing in the second error 
> message), then let's see how the testsuite likes it.
> 

While I prefer the first error message above, if it requires
too much polish, then at least commit your first patch to cure
the ICE.  We can worry about polish later.

-- 
Steve

  reply	other threads:[~2015-10-02 16:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-01  0:06 Steve Kargl
2015-10-01  0:07 ` Steve Kargl
2015-10-01 12:16   ` Mikael Morin
2015-10-01 13:29     ` Mikael Morin
2015-10-01 16:30       ` Steve Kargl
2015-10-02  9:28         ` Mikael Morin
2015-10-02 16:44           ` Steve Kargl [this message]
2015-10-03 10:13             ` Mikael Morin
2015-10-03 19:09               ` Steve Kargl

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=20151002164442.GB12835@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=mikael.morin@sfr.fr \
    /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).