public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/34292] New: fortran initialization code does not compile
@ 2007-11-29 13:27 pspftf-bugzilla at yahoo dot de
2007-11-29 15:08 ` [Bug fortran/34292] " burnus at gcc dot gnu dot org
0 siblings, 1 reply; 2+ messages in thread
From: pspftf-bugzilla at yahoo dot de @ 2007-11-29 13:27 UTC (permalink / raw)
To: gcc-bugs
Hi,
the following program does not compile. Omiting the data statement leads to a
compile without notice.
program bsp
INTEGER :: I,J
REAL ::X(2,2)=0.
!code compiles, if the following line is commented out.
DATA (( X(I,J), I=1,2), J=1,2) / 4*0. /
end program bsp
Output on my machine:
$ f95 -v bsp.f95
Driving: f95 -v bsp.f95 -lgfortranbegin -lgfortran -lm -shared-libgcc
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v
--enable-languages=c,c++,fortran,objc,obj-c++,treelang --prefix=/usr
--enable-shared --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix --enable-nls
--program-suffix=-4.1 --enable-__cxa_atexit --enable-clocale=gnu
--enable-libstdcxx-debug --enable-mpfr --enable-checking=release i486-linux-gnu
Thread model: posix
gcc version 4.1.2 (Ubuntu 4.1.2-0ubuntu4)
/usr/lib/gcc/i486-linux-gnu/4.1.2/f951 bsp.f95 -quiet -dumpbase bsp.f95
-mtune=generic -auxbase bsp -version -fstack-protector -o /tmp/cch4S83a.s
GNU F95 version 4.1.2 (Ubuntu 4.1.2-0ubuntu4) (i486-linux-gnu)
compiled by GNU C version 4.1.2 (Ubuntu 4.1.2-0ubuntu4).
GGC heuristics: --param ggc-min-expand=90 --param ggc-min-heapsize=113084
bsp.f95:0: internal compiler error: in gfc_assign_data_value, at
fortran/data.c:274
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.
For Debian GNU/Linux specific bug reporting instructions,
see <URL:file:///usr/share/doc/gcc-4.1/README.Bugs>.
--
Summary: fortran initialization code does not compile
Product: gcc
Version: 4.1.2
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: pspftf-bugzilla at yahoo dot de
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34292
^ permalink raw reply [flat|nested] 2+ messages in thread
* [Bug fortran/34292] fortran initialization code does not compile
2007-11-29 13:27 [Bug fortran/34292] New: fortran initialization code does not compile pspftf-bugzilla at yahoo dot de
@ 2007-11-29 15:08 ` burnus at gcc dot gnu dot org
0 siblings, 0 replies; 2+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-11-29 15:08 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from burnus at gcc dot gnu dot org 2007-11-29 15:08 -------
This is an internal compiler error on invalid code.
REAL ::X(2,2)=0.
DATA (( X(I,J), I=1,2), J=1,2) / 4*0. /
You initialize the variable X twice, which is not allowed according to the
Fortran standard (although some compiler accept it using the default options).
You have to use either:
REAL :: X(2,2) = 0.0
or
REAL :: X(2,2)
DATA (( X(I,J), I=1,2), J=1,2) / 4*0. /
Either of the two versions work here with gfortran 4.1.x, 4.2.x and 4.3.0.
The internal compiler error is fixed in gfortran 4.3.0, which shows the
following error message:
aaa.f90:5.17:
DATA (( X(I,J), I=1,2), J=1,2) / 4*4. /
1
aaa.f90:3.23:
REAL ::X(2,2) =0.
2
Error: 'x' at (1) already is initialized at (2)
I therefore close this bug.
--
burnus at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |burnus at gcc dot gnu dot
| |org
Status|UNCONFIRMED |RESOLVED
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34292
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-11-29 15:08 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 13:27 [Bug fortran/34292] New: fortran initialization code does not compile pspftf-bugzilla at yahoo dot de
2007-11-29 15:08 ` [Bug fortran/34292] " burnus 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).