Bug 16935 - Segmentation fault of compiler with unsupported control items in OPEN
Summary: Segmentation fault of compiler with unsupported control items in OPEN
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libfortran (show other bugs)
Version: 4.0.0
: P2 normal
Target Milestone: 4.0.0
Assignee: Bud Davis
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2004-08-09 14:15 UTC by Paul Thomas
Modified: 2004-08-13 22:05 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2004-08-13 02:08:39


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Thomas 2004-08-09 14:15:45 UTC
!G77 complains that this is an unsupported control item.
!GFORTRAN compiles OK put program gives segmentation fault
!I have not checked the other control items but strongly urge a G77 style
!error message for standard but unsupported items.
!distilled from Meissner text book example
       program bug2
       implicit none
       character*(500)  String
       open( 1 , file = "str_500.txt", position = "REWIND" )
       read( 1 , * ) String
       close( 1 ) 
       stop
       end

str_500.txt contains

"A character string consists of zero or more characters. Even though it is made
up of individual characters, a character string is considered to be a scalar. As
with any data type, it is possible to declare an array of character strings, all
the same length. A substring is a contiguous portion of a character string that
has a starting point and an ending point within the character string. It is
possible to reference a substring of a character scalar variable or constant."
Comment 1 Bud Davis 2004-08-13 02:04:10 UTC
proposed patch here:

http://gcc.gnu.org/ml/fortran/2004-08/msg00072.html

Comment 2 Andrew Pinski 2004-08-13 02:08:39 UTC
Confirmed.
Comment 3 Andrew Pinski 2004-08-13 22:04:49 UTC
Fixed, Bud put the wrong PR number on the commit message.
Comment 4 Andrew Pinski 2004-08-13 22:05:07 UTC
Closing now.