public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/36267]  New: Segfault ICE on assignment of a string pointer to a substring target
@ 2008-05-19 22:32 jkrahn at nc dot rr dot com
  2008-05-19 22:39 ` [Bug fortran/36267] " kargl at gcc dot gnu dot org
  2008-05-20  8:22 ` [Bug fortran/36267] [4.2 only] " fxcoudert at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: jkrahn at nc dot rr dot com @ 2008-05-19 22:32 UTC (permalink / raw)
  To: gcc-bugs

Gfortran segfaults where a string pointer is pointed to a target that is a
substring reference (see example below). If I wrap the assignment in a
subroutine, the pointer assignment to a substring works, so the problem is in
the parser.

$ cat bug.f90
character(len=1), pointer :: p
character(len=10), target :: string
p => string(1:1)
end

$ gfortran -c bug.f90
bug.f90:0: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://bugzilla.redhat.com/bugzilla> for instructions.


-- 
           Summary: Segfault ICE on assignment of a string pointer to a
                    substring target
           Product: gcc
           Version: 4.2.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jkrahn at nc dot rr dot com


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


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

* [Bug fortran/36267] Segfault ICE on assignment of a string pointer to a substring target
  2008-05-19 22:32 [Bug fortran/36267] New: Segfault ICE on assignment of a string pointer to a substring target jkrahn at nc dot rr dot com
@ 2008-05-19 22:39 ` kargl at gcc dot gnu dot org
  2008-05-20  8:22 ` [Bug fortran/36267] [4.2 only] " fxcoudert at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: kargl at gcc dot gnu dot org @ 2008-05-19 22:39 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from kargl at gcc dot gnu dot org  2008-05-19 22:38 -------
Works for me on 4.4.0

mobile:kargl[208] cat w2.f90
character(len=1), pointer :: p
character(len=10), target :: string
p => string(1:1)
end
mobile:kargl[209] ~/work/bin/gfortran -o z -static w2.f90
mobile:kargl[210] ~/work/bin/gfortran --version
GNU Fortran (GCC) 4.4.0 20080519 (experimental)


-- 

kargl at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.4.0


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


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

* [Bug fortran/36267] [4.2 only] Segfault ICE on assignment of a string pointer to a substring target
  2008-05-19 22:32 [Bug fortran/36267] New: Segfault ICE on assignment of a string pointer to a substring target jkrahn at nc dot rr dot com
  2008-05-19 22:39 ` [Bug fortran/36267] " kargl at gcc dot gnu dot org
@ 2008-05-20  8:22 ` fxcoudert at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-05-20  8:22 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2008-05-20 08:22 -------
This bug is fixed in gfortran-4.3.0 and later. Please migrate to a more recent
compiler version; binaries for common systems can be found at
http://gcc.gnu.org/wiki/GFortranBinaries.

Closing as we don't fix bugs in the 4.2 branch except for very special cases
(no further release of the 4.2 branch is planned).


-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
      Known to work|4.4.0                       |4.4.0 4.3.0
         Resolution|                            |WONTFIX
            Summary|Segfault ICE on assignment  |[4.2 only] Segfault ICE on
                   |of a string pointer to a    |assignment of a string
                   |substring target            |pointer to a substring
                   |                            |target


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


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

end of thread, other threads:[~2008-05-20  8:22 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-05-19 22:32 [Bug fortran/36267] New: Segfault ICE on assignment of a string pointer to a substring target jkrahn at nc dot rr dot com
2008-05-19 22:39 ` [Bug fortran/36267] " kargl at gcc dot gnu dot org
2008-05-20  8:22 ` [Bug fortran/36267] [4.2 only] " fxcoudert 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).