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