public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25062]  New: better diagnostic needed
@ 2005-11-26 17:50 jv244 at cam dot ac dot uk
  2005-11-26 19:41 ` [Bug fortran/25062] same name for parameter and common block fxcoudert at gcc dot gnu dot org
                   ` (10 more replies)
  0 siblings, 11 replies; 13+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:50 UTC (permalink / raw)
  To: gcc-bugs

using GNU Fortran 95 (GCC) 4.1.0 20051126 (prerelease)  with '-g -pedantic
-std=f95', I get a bad / no diagnostic for the following invalid code:

INTEGER, PARAMETER ::  C1=1
COMMON /C1/ I
INTEGER I
END


-- 
           Summary: better diagnostic needed
           Product: gcc
           Version: 4.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jv244 at cam dot ac dot uk


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-26 19:41 ` fxcoudert at gcc dot gnu dot org
  2006-01-11 14:29 ` tobi at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-26 19:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:41 -------
Well, only g95 sees this bug. Is it really a violation of the standard? I don't
think so...

## g95 ##
In file foo.f90:1

INTEGER, PARAMETER ::  C1=1
                         1
Error: COMMON block 'c1' at (1) is also a PARAMETER
## Intel ##
## Portland ##
## Sun ##


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|better diagnostic needed    |same name for parameter and
                   |                            |common block


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:41 ` [Bug fortran/25062] same name for parameter and common block fxcoudert at gcc dot gnu dot org
@ 2006-01-11 14:29 ` tobi at gcc dot gnu dot org
  2006-01-11 14:32 ` pinskia at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-01-11 14:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from tobi at gcc dot gnu dot org  2006-01-11 14:29 -------
I'm quite sure it's not, but it would be a first, if Joost were wrong.  Is
there anything special about parameters?  Something like
   real x
   common /x/ y
or even
   common /x/ x
is perfectly valid.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tobi at gcc dot gnu dot org


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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:41 ` [Bug fortran/25062] same name for parameter and common block fxcoudert at gcc dot gnu dot org
  2006-01-11 14:29 ` tobi at gcc dot gnu dot org
@ 2006-01-11 14:32 ` pinskia at gcc dot gnu dot org
  2006-01-11 15:57 ` jv244 at cam dot ac dot uk
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-01-11 14:32 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-01-11 14:32 -------
Even Lahey's Fortran 90 and their 95 compiler does not error out about this.

I wonder if xlf does.


-- 


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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2006-01-11 14:32 ` pinskia at gcc dot gnu dot org
@ 2006-01-11 15:57 ` jv244 at cam dot ac dot uk
  2006-01-12  0:18 ` tobi at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: jv244 at cam dot ac dot uk @ 2006-01-11 15:57 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from jv244 at cam dot ac dot uk  2006-01-11 15:57 -------
(In reply to comment #3)
> Even Lahey's Fortran 90 and their 95 compiler does not error out about this.
> 
> I wonder if xlf does.
> 

xlf90 -qsuffix=f=f90 mytest.f90
"mytest.f90", line 2.9: 1514-259 (S) A name must not be both the name of a
named constant and the name of a COMMON block.


-- 


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



^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2006-01-11 15:57 ` jv244 at cam dot ac dot uk
@ 2006-01-12  0:18 ` tobi at gcc dot gnu dot org
  2006-01-12  5:25 ` kargl at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-01-12  0:18 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from tobi at gcc dot gnu dot org  2006-01-12 00:18 -------
I'm setting this to waiting until someone quotes something from the standard. 

Fortran has its quirks, but disallowing this special case would break the
distintion between the names of commons and those of other named objects, which
is otherwise maintained, so I'm sure this is valid code.  But since being sure
is not sufficient, I also checked the standard and I couldn't find anything
disallowing this case.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |WAITING


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2006-01-12  0:18 ` tobi at gcc dot gnu dot org
@ 2006-01-12  5:25 ` kargl at gcc dot gnu dot org
  2006-01-12 10:13 ` tobi at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-01-12  5:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from kargl at gcc dot gnu dot org  2006-01-12 05:25 -------
See 14.1.2.1.
   A common block name in a scoping unit also may be the name of any local
   entity other than a named constant, intrinsic procedure, or a local variable
   that is also an external function in a function subprogram.


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kargl at gcc dot gnu dot org
   Last reconfirmed|2006-01-11 23:46:46         |2006-01-12 05:25:44
               date|                            |


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2006-01-12  5:25 ` kargl at gcc dot gnu dot org
@ 2006-01-12 10:13 ` tobi at gcc dot gnu dot org
  2007-06-26 16:22 ` burnus at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: tobi at gcc dot gnu dot org @ 2006-01-12 10:13 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from tobi at gcc dot gnu dot org  2006-01-12 10:13 -------
Thanks, Steve.


-- 

tobi at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |NEW
   Last reconfirmed|2006-01-12 05:25:44         |2006-01-12 10:13:46
               date|                            |


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (6 preceding siblings ...)
  2006-01-12 10:13 ` tobi at gcc dot gnu dot org
@ 2007-06-26 16:22 ` burnus at gcc dot gnu dot org
  2007-06-26 16:25 ` patchapp at dberlin dot org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-06-26 16:22 UTC (permalink / raw)
  To: gcc-bugs



-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |burnus at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-01-12 10:13:46         |2007-06-26 16:21:47
               date|                            |
   Target Milestone|---                         |4.3.0


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (7 preceding siblings ...)
  2007-06-26 16:22 ` burnus at gcc dot gnu dot org
@ 2007-06-26 16:25 ` patchapp at dberlin dot org
  2007-07-03 21:41 ` burnus at gcc dot gnu dot org
  2007-07-03 21:45 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: patchapp at dberlin dot org @ 2007-06-26 16:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from patchapp at dberlin dot org  2007-06-26 16:25 -------
Subject: Bug number PR 25062

A patch for this bug has been added to the patch tracker.
The mailing list url for the patch is
http://gcc.gnu.org/ml/gcc-patches/2007-06/msg01932.html


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (8 preceding siblings ...)
  2007-06-26 16:25 ` patchapp at dberlin dot org
@ 2007-07-03 21:41 ` burnus at gcc dot gnu dot org
  2007-07-03 21:45 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-03 21:41 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from burnus at gcc dot gnu dot org  2007-07-03 21:41 -------
Subject: Bug 25062

Author: burnus
Date: Tue Jul  3 21:41:34 2007
New Revision: 126279

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=126279
Log:
2007-07-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/25062
        * resolve.c (resolve_common_blocks): New check function.
        (resolve_types): Use it.

2007-07-03  Tobias Burnus  <burnus@net-b.de>

        PR fortran/25062
        * common_7.f90: New.
        * common_8.f90: New.
        * common_9.f90: New.


Added:
    trunk/gcc/testsuite/gfortran.dg/common_7.f90
    trunk/gcc/testsuite/gfortran.dg/common_8.f90
    trunk/gcc/testsuite/gfortran.dg/common_9.f90
Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/resolve.c
    trunk/gcc/testsuite/ChangeLog


-- 


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
  2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (9 preceding siblings ...)
  2007-07-03 21:41 ` burnus at gcc dot gnu dot org
@ 2007-07-03 21:45 ` burnus at gcc dot gnu dot org
  10 siblings, 0 replies; 13+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-03 21:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from burnus at gcc dot gnu dot org  2007-07-03 21:45 -------
Fixed. Note that the F95 standard is stricter than F2003. I added one -std=95
only check and two general checks. Still gfortran is too strict for F2003; see
PR32515.


-- 

burnus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/25062] same name for parameter and common block
       [not found] <bug-25062-4@http.gcc.gnu.org/bugzilla/>
@ 2011-08-13 11:23 ` dominiq at lps dot ens.fr
  0 siblings, 0 replies; 13+ messages in thread
From: dominiq at lps dot ens.fr @ 2011-08-13 11:23 UTC (permalink / raw)
  To: gcc-bugs

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

Dominique d'Humieres <dominiq at lps dot ens.fr> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |zeccav at gmail dot com

--- Comment #12 from Dominique d'Humieres <dominiq at lps dot ens.fr> 2011-08-13 11:21:34 UTC ---
*** Bug 50072 has been marked as a duplicate of this bug. ***


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-08-13 11:22 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:50 [Bug fortran/25062] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-26 19:41 ` [Bug fortran/25062] same name for parameter and common block fxcoudert at gcc dot gnu dot org
2006-01-11 14:29 ` tobi at gcc dot gnu dot org
2006-01-11 14:32 ` pinskia at gcc dot gnu dot org
2006-01-11 15:57 ` jv244 at cam dot ac dot uk
2006-01-12  0:18 ` tobi at gcc dot gnu dot org
2006-01-12  5:25 ` kargl at gcc dot gnu dot org
2006-01-12 10:13 ` tobi at gcc dot gnu dot org
2007-06-26 16:22 ` burnus at gcc dot gnu dot org
2007-06-26 16:25 ` patchapp at dberlin dot org
2007-07-03 21:41 ` burnus at gcc dot gnu dot org
2007-07-03 21:45 ` burnus at gcc dot gnu dot org
     [not found] <bug-25062-4@http.gcc.gnu.org/bugzilla/>
2011-08-13 11:23 ` dominiq at lps dot ens.fr

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