public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/37999] New: Fortran shape and kind intrinsic
@ 2008-11-02 23:35 carbess at swcp dot com
2008-11-03 0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: carbess at swcp dot com @ 2008-11-02 23:35 UTC (permalink / raw)
To: gcc-bugs
Shape intrinsic does not allow scalar arguments as required by f90/f95/f03
standards. Example code follows:
program test_shape ! Segmentation fault generated when executable executed
integer :: i
print *, shape( i ) ! Shape of a scalar allowed by f90, f95, f03
! standards.
end program test_shape
Kind intrinsic with character argument in type declaration fails: Example
follows:
! Compiler version:
! GNU Fortran (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu3)
! Copyright (C) 2007 Free Software Foundation, Inc.
character (len = 3, kind = kind("a" ) c ! Compiler fails with internal error
-- invalid syntax
! character (len = 3, kind = kind("a") ) c ! Fails compilation -- invalid
kind
! value returned -- that is, minus
! integer huge. Notice the
! kind("a") is correctly returned
! as 1 in print statement below
and
! kind=1 works in a character
! declaration.
! character (len = 3, kind = 1) c ! Works
c = "b"
print *, kind("a"), c
end program
--
Summary: Fortran shape and kind intrinsic
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: fortran
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: carbess at swcp dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37999] Fortran shape and kind intrinsic
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
@ 2008-11-03 0:01 ` kargl at gcc dot gnu dot org
2008-11-03 16:33 ` carbess at swcp dot com
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-11-03 0:01 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from kargl at gcc dot gnu dot org 2008-11-03 00:00 -------
Code works with 4.3.2 and trunk.
Note you probably want to
1) Update to a 4.3.2 or newer compiler.
2) Change the example to
program test_shape
integer :: i
print *, size(shape(i)) ! Shape of a scalar allowed by f95 standards.
end program test_shape
because shape(i) is a zero sized array.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37999] Fortran shape and kind intrinsic
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
2008-11-03 0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
@ 2008-11-03 16:33 ` carbess at swcp dot com
2008-11-03 18:43 ` kargl at gcc dot gnu dot org
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: carbess at swcp dot com @ 2008-11-03 16:33 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from carbess at swcp dot com 2008-11-03 16:32 -------
Subject: Re: Fortran shape and kind intrinsic
Thanks for the response. I will download the latest compiler, which I
thought I had. I guess the autoupdate for my Mint Linux is not working
promptly or this has been updated in the last two weeks. With the new
version, I will check the second problem I reported as well and report back
(kind intrinsic with character argument in a type declararation statement).
Thanks again and appreciate you help -- you have saved me of creating a
workaround for the GNU compilers for my large application code for the shape
intrinsic -- the code I gave is the simplest extraction I could think of
but your recommendation for this test is clearly better.
----- Original Message -----
From: "kargl at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: <carbess@swcp.com>
Sent: Sunday, November 02, 2008 5:00 PM
Subject: [Bug fortran/37999] Fortran shape and kind intrinsic
>
>
> ------- Comment #1 from kargl at gcc dot gnu dot org 2008-11-03
> 00:00 -------
> Code works with 4.3.2 and trunk.
>
> Note you probably want to
>
> 1) Update to a 4.3.2 or newer compiler.
> 2) Change the example to
>
> program test_shape
> integer :: i
> print *, size(shape(i)) ! Shape of a scalar allowed by f95 standards.
> end program test_shape
>
> because shape(i) is a zero sized array.
>
>
> --
>
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
>
> ------- You are receiving this mail because: -------
> You reported the bug, or are watching the reporter.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37999] Fortran shape and kind intrinsic
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
2008-11-03 0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
2008-11-03 16:33 ` carbess at swcp dot com
@ 2008-11-03 18:43 ` kargl at gcc dot gnu dot org
2008-11-03 22:18 ` burnus at gcc dot gnu dot org
2008-11-11 5:29 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-11-03 18:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from kargl at gcc dot gnu dot org 2008-11-03 18:41 -------
(In reply to comment #2)
> With the new version, I will check the second problem I reported
> as well and report back (kind intrinsic with character argument
> in a type declararation statement)
The 2nd problem is also fixed in 4.3.2 and newer gfortran.
character (len = 3, kind = kind("a" ) c
c = "b"
print *, kind("a"), c
end program
troutmask:kargl[203] ~/../sgk/work/4x/bin/gfortran -static -o z t.f90
t.f90:1.42:
character (len = 3, kind = kind("a" ) c
1
Error: Syntax error in CHARACTER declaration at (1)
t.f90:2.7:
c = "b"
1
Error: Can't convert CHARACTER(1) to REAL(4) at (1)
The second error is a side effect of the first error.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37999] Fortran shape and kind intrinsic
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
` (2 preceding siblings ...)
2008-11-03 18:43 ` kargl at gcc dot gnu dot org
@ 2008-11-03 22:18 ` burnus at gcc dot gnu dot org
2008-11-11 5:29 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: burnus at gcc dot gnu dot org @ 2008-11-03 22:18 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from burnus at gcc dot gnu dot org 2008-11-03 22:17 -------
"print *, shape( i )"
That program works here with GCC 4.1.3, 4.2.1 and 4.3.3-20081002 of openSUSE,
and with 4.3.3-20081103 and 4.4.0 of today. I not even get any valgrind error.
Character tests:
I can reproduce the ICE with 4.2, it works with 4.3/4.4.
> I will download the latest compiler, which I thought I had.
> I guess the autoupdate for my Mint Linux is not working
> promptly or this has been updated in the last two weeks.
Note: Distributions are slow at updating the compiler as it is the core part
and can cause a lot of problem.
4.3.0 was released 2008-03-05 and 4.3.x is said to be a very well working
version from the C/middle-end part. Also the Fortran part is in a pretty good
shape.
4.4.0 is not yet released but exists as developer version, which is daily
updated but can only get regression fixes. Nightly Linux builds are available
from: http://gcc.gnu.org/wiki/GFortranBinaries
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
* [Bug fortran/37999] Fortran shape and kind intrinsic
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
` (3 preceding siblings ...)
2008-11-03 22:18 ` burnus at gcc dot gnu dot org
@ 2008-11-11 5:29 ` jvdelisle at gcc dot gnu dot org
4 siblings, 0 replies; 6+ messages in thread
From: jvdelisle at gcc dot gnu dot org @ 2008-11-11 5:29 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from jvdelisle at gcc dot gnu dot org 2008-11-11 05:28 -------
Closing, not a bug any more.
--
jvdelisle at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |WORKSFORME
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37999
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2008-11-11 5:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-02 23:35 [Bug fortran/37999] New: Fortran shape and kind intrinsic carbess at swcp dot com
2008-11-03 0:01 ` [Bug fortran/37999] " kargl at gcc dot gnu dot org
2008-11-03 16:33 ` carbess at swcp dot com
2008-11-03 18:43 ` kargl at gcc dot gnu dot org
2008-11-03 22:18 ` burnus at gcc dot gnu dot org
2008-11-11 5:29 ` 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).