Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Problem with DATA statement

7 views
Skip to first unread message

Arjen Markus

unread,
Jun 12, 2007, 4:56:23 AM6/12/07
to
Hello,

the following program gives an internal compiler error with Compaq
Visual Fortran 6.6C
(I know, it is no longer supported) but the Intel Visual Fortran
compiler is rather too
happy to compile it IMHO:

! Check a particular compiler error
! (Happens in CVF 6.6C)
!
program chkdata

character(len=20), dimension(4) :: string

data ( string(i) ,i=1,5 ) / &
'A', 'B', 'C', 'D', 'E' /

write(*,*) string
end program chkdata

The CVF error message is:

Assertion failure: Compiler internal error - please submit problem
report
GEM ASSERTION, Compiler internal error - please submit problem report
f90: Fatal: There has been an internal compiler error (E0000003).
Error executing df.exe.

chkdata.exe - 3 error(s), 0 warning(s)

The output when using IVF on Linux:

> chkd
A B C
D

As you can see, the effect seems to be that it simply truncates the
array of
strings to fit into the declared array.

Is there a flag for IVF to warn about this type of error?

(I found the cause of the error by running g95 on the source code that
initially
caused this. At the moment I do not know what version, but a version
from 2005
clearly does not detect it).

Regards,

Arjen

David Frank

unread,
Jun 12, 2007, 9:09:28 AM6/12/07
to
Patient> "doctor it hurts when I code my programs like this"
Doctor> "too much verbosity, code your programs like this"

character(20) :: string(4) = ['A', 'B', 'C', 'D']

<g>

"Arjen Markus" <arjen....@wldelft.nl> wrote in message
news:1181638583.9...@o11g2000prd.googlegroups.com...

Arjen Markus

unread,
Jun 12, 2007, 9:52:28 AM6/12/07
to
On 12 jun, 15:09, "David Frank" <dave_fr...@hotmail.com> wrote:
> Patient> "doctor it hurts when I code my programs like this"
> Doctor> "too much verbosity, code your programs like this"
>
> character(20) :: string(4) = ['A', 'B', 'C', 'D']
>
> <g>
>
> "Arjen Markus" <arjen.mar...@wldelft.nl> wrote in message

>
> news:1181638583.9...@o11g2000prd.googlegroups.com...
>
>
>
> > Hello,
>
> > the following program gives an internal compiler error with Compaq
> > Visual Fortran 6.6C
> > (I know, it is no longer supported) but the Intel Visual Fortran
> > compiler is rather too
> > happy to compile it IMHO:
>
> > ! Check a particular compiler error
> > ! (Happens in CVF 6.6C)
> > !
> > program chkdata
>
> > character(len=20), dimension(4) :: string
>
> > data ( string(i) ,i=1,5 ) / &
> > 'A', 'B', 'C', 'D', 'E' /
>
> > write(*,*) string
> > end program chkdata- Tekst uit oorspronkelijk bericht niet weergeven -
>
> - Tekst uit oorspronkelijk bericht weergeven -

The problem is not so much the verbosity as the fact that
there is a mismatch in the number of elements and the compilers
do not indicate that in a clear/meaningful way.

Regards,

Arjen

Intel.Ro...@gmail.com

unread,
Jun 12, 2007, 5:41:19 PM6/12/07
to


This is a bug. I entered a bug report on this issue. This actually
causes an internal compiler error on the newer 9.1 compilers and the
just-released 10.0 compiler. I'll make sure it gets fixed.

ron

John Harper

unread,
Jun 12, 2007, 6:00:45 PM6/12/07
to
In article <1181638583.9...@o11g2000prd.googlegroups.com>,

Arjen Markus <arjen....@wldelft.nl> wrote:
>Hello,
>
>the following program gives an internal compiler error with Compaq
>Visual Fortran 6.6C
>(I know, it is no longer supported) but the Intel Visual Fortran
>compiler is rather too happy to compile it IMHO:
>
...

> character(len=20), dimension(4) :: string
>
> data ( string(i) ,i=1,5 ) / &
> 'A', 'B', 'C', 'D', 'E' /
...

>(I found the cause of the error by running g95 on the source code that
>initially caused this. At the moment I do not know what version, but a
>version from 2005 clearly does not detect it).

G95 as of May 29 2007 does correctly diagnose the program error. So do
both NAG and Sun f95. But Compaq Fortran Compiler V5.5-1877-48BBF
(pretty old by now) gives the same wrong output as Intel.

-- John Harper, School of Mathematics, Statistics and Computer Science,
Victoria University, PO Box 600, Wellington 6140, New Zealand
e-mail john....@vuw.ac.nz phone (+64)(4)463 5341 fax (+64)(4)463 5045

Arjen Markus

unread,
Jun 13, 2007, 12:47:35 AM6/13/07
to
On 12 jun, 23:41, Intel.Ron.W.gr...@gmail.com wrote:

>
> This is a bug. I entered a bug report on this issue. This actually
> causes an internal compiler error on the newer 9.1 compilers and the
> just-released 10.0 compiler. I'll make sure it gets fixed.
>
> ron

Thanks. I was not sure whether the Intel compiler was correcting the
problem "automatically" by ignoring the extra elements or not.

Regards,

Arjen

robin

unread,
Jun 14, 2007, 12:40:43 PM6/14/07
to
"Arjen Markus" <arjen....@wldelft.nl> wrote in message
news:1181638583.9...@o11g2000prd.googlegroups.com...

> Hello,
>
> the following program gives an internal compiler error with Compaq
> Visual Fortran 6.6C

The program contains an error, namely,
that STRING has 4 elements, while the DATA statement
attempt to initialize it with 5 elements.

Arjen Markus

unread,
Jun 14, 2007, 4:21:21 PM6/14/07
to
On 14 jun, 18:40, "robin" <robi...@bigpond.com> wrote:
> "Arjen Markus" <arjen.mar...@wldelft.nl> wrote in message

Sure, but in the original program the compiler threw an internal error
with no indication of the cause (a different compiler did detect the
error) and it turns out that yet a third has problems with this type
of errors too. So my question/post was related to the compiler
problem,
not so much to the problem with the program as such.

Regards,

Arjen

0 new messages