public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/25057]  New: better diagnostic needed
@ 2005-11-26 17:48 jv244 at cam dot ac dot uk
  2005-11-26 19:24 ` [Bug fortran/25057] default initialization and DATA statement conflict fxcoudert at gcc dot gnu dot org
                   ` (8 more replies)
  0 siblings, 9 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2005-11-26 17:48 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:

TYPE T1
 INTEGER :: I=7
END TYPE T1
TYPE(T1), SAVE, DIMENSION(4) :: D
DATA (D(I),I=1,2) /T1(3),T1(3)/
IF (ANY(D%I.NE.(/3,3,7,7/))) write(6,*) "Never mind ..."
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=25057


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
@ 2005-11-26 19:24 ` fxcoudert at gcc dot gnu dot org
  2006-11-03 16:30 ` jvdelisle at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2005-11-26 19:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2005-11-26 19:24 -------
We currently have an ICE on that one:

## gfortran ##
foo.f90:0: internal compiler error: in gfc_assign_data_value, at
fortran/data.c:252

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

DATA (D(I),I=1,2) /T1(3),T1(3)/
       1
Error: Variable 'd' which has a default initialization cannot appear in a DATA
statement at (1)
## Intel ##
## Portland ##
PGF90-W-0164-Overlapping data initializations of d (foo.f90)
  0 inform,   1 warnings,   0 severes, 0 fatal for MAIN
## Sun ##

DATA (D(I),I=1,2) /T1(3),T1(3)/
      ^
"foo.f90", Line = 5, Column = 7: ERROR: "D" must not be specified in a DATA
statement.  It is typed as derived type "T1", which is default initialized.


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|                            |ice-on-invalid-code
   Last reconfirmed|0000-00-00 00:00:00         |2005-11-26 19:24:21
               date|                            |
            Summary|better diagnostic needed    |default initialization and
                   |                            |DATA statement conflict


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:24 ` [Bug fortran/25057] default initialization and DATA statement conflict fxcoudert at gcc dot gnu dot org
@ 2006-11-03 16:30 ` jvdelisle at gcc dot gnu dot org
  2006-12-10  8:48 ` jvdelisle at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-11-03 16:30 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from jvdelisle at gcc dot gnu dot org  2006-11-03 16:30 -------
This is probably a duplicate of 24978.


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  BugsThisDependsOn|                            |24978


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
  2005-11-26 19:24 ` [Bug fortran/25057] default initialization and DATA statement conflict fxcoudert at gcc dot gnu dot org
  2006-11-03 16:30 ` jvdelisle at gcc dot gnu dot org
@ 2006-12-10  8:48 ` jvdelisle at gcc dot gnu dot org
  2006-12-10 14:24 ` burnus at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2006-12-10  8:48 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from jvdelisle at gcc dot gnu dot org  2006-12-10 08:48 -------
Just one question (A patch is on the way)

Is this legal?

TYPE T1
 INTEGER :: I
END TYPE T1
TYPE(T1), SAVE, DIMENSION(4) :: D
DATA (D(I),I=1,2) /T1(3),T1(3)/

END


-- 


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (2 preceding siblings ...)
  2006-12-10  8:48 ` jvdelisle at gcc dot gnu dot org
@ 2006-12-10 14:24 ` burnus at gcc dot gnu dot org
  2006-12-10 16:27 ` burnus at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-12-10 14:24 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from burnus at gcc dot gnu dot org  2006-12-10 14:24 -------
> Is this legal?
> 
> TYPE T1
>  INTEGER :: I
> END TYPE T1
> TYPE(T1), SAVE, DIMENSION(4) :: D
> DATA (D(I),I=1,2) /T1(3),T1(3)/

I think it is. I didn't found anything which said otherwise and all compilers
accepted it.

The relavant part of the standard, which disallows it is (Fortran 2003):

"explicit initialization (5.1) : Explicit initialization may be specified for
objects of intrinsic or derived type in type declaration statements or DATA
statements. An object of a derived type that specifies default initialization
shall not appear in a DATA statement."
(and 3 paragraphs above "5.1.1".)


-- 


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (3 preceding siblings ...)
  2006-12-10 14:24 ` burnus at gcc dot gnu dot org
@ 2006-12-10 16:27 ` burnus at gcc dot gnu dot org
  2007-01-02  5:07 ` jvdelisle at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: burnus at gcc dot gnu dot org @ 2006-12-10 16:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from burnus at gcc dot gnu dot org  2006-12-10 16:27 -------
(In reply to comment #4)
> > Is this legal?
>
> I think it is. I didn't found anything which said otherwise and all compilers
> accepted it.
This is with regards to the code in comment #3.

Whereas the following is meant with regards to the code in comment #0.
> The relavant part of the standard, which disallows it is (Fortran 2003):


-- 

burnus at gcc dot gnu dot org changed:

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


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (4 preceding siblings ...)
  2006-12-10 16:27 ` burnus at gcc dot gnu dot org
@ 2007-01-02  5:07 ` jvdelisle at gcc dot gnu dot org
  2007-02-01  7:18 ` jvdelisle at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-01-02  5:07 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from jvdelisle at gcc dot gnu dot org  2007-01-02 05:06 -------
Still working on it!


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |jvdelisle at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2006-02-06 14:03:02         |2007-01-02 05:06:57
               date|                            |


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (5 preceding siblings ...)
  2007-01-02  5:07 ` jvdelisle at gcc dot gnu dot org
@ 2007-02-01  7:18 ` jvdelisle at gcc dot gnu dot org
  2007-07-03 18:27 ` jv244 at cam dot ac dot uk
  2007-07-04  1:25 ` jvdelisle at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-02-01  7:18 UTC (permalink / raw)
  To: gcc-bugs



-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|jvdelisle at gcc dot gnu dot|unassigned at gcc dot gnu
                   |org                         |dot org
             Status|ASSIGNED                    |NEW


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (6 preceding siblings ...)
  2007-02-01  7:18 ` jvdelisle at gcc dot gnu dot org
@ 2007-07-03 18:27 ` jv244 at cam dot ac dot uk
  2007-07-04  1:25 ` jvdelisle at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jv244 at cam dot ac dot uk @ 2007-07-03 18:27 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #7 from jv244 at cam dot ac dot uk  2007-07-03 18:27 -------
this has become:
Error: 'd' at (1) already is initialized at (2)
test.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,


-- 


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


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

* [Bug fortran/25057] default initialization and DATA statement conflict
  2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
                   ` (7 preceding siblings ...)
  2007-07-03 18:27 ` jv244 at cam dot ac dot uk
@ 2007-07-04  1:25 ` jvdelisle at gcc dot gnu dot org
  8 siblings, 0 replies; 10+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2007-07-04  1:25 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from jvdelisle at gcc dot gnu dot org  2007-07-04 01:25 -------
This is OK now with the patch to 32432 committed today. Closing as duplicate.

*** This bug has been marked as a duplicate of 32432 ***


-- 

jvdelisle at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2007-07-04  1:25 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-26 17:48 [Bug fortran/25057] New: better diagnostic needed jv244 at cam dot ac dot uk
2005-11-26 19:24 ` [Bug fortran/25057] default initialization and DATA statement conflict fxcoudert at gcc dot gnu dot org
2006-11-03 16:30 ` jvdelisle at gcc dot gnu dot org
2006-12-10  8:48 ` jvdelisle at gcc dot gnu dot org
2006-12-10 14:24 ` burnus at gcc dot gnu dot org
2006-12-10 16:27 ` burnus at gcc dot gnu dot org
2007-01-02  5:07 ` jvdelisle at gcc dot gnu dot org
2007-02-01  7:18 ` jvdelisle at gcc dot gnu dot org
2007-07-03 18:27 ` jv244 at cam dot ac dot uk
2007-07-04  1:25 ` jvdelisle at gcc dot gnu dot org

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