public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/31193]  New: ICE on count(transfer(...)...), with non-constant transfer arguments.
@ 2007-03-16  4:38 brooks at gcc dot gnu dot org
  2007-03-16  6:54 ` [Bug fortran/31193] ICE on non-constant character tranfert fxcoudert at gcc dot gnu dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-16  4:38 UTC (permalink / raw)
  To: gcc-bugs

There are known problems with attempts at folding TRANSFER in constant
expressions.  However, the following code doesn't involve this, and should work
properly even if folding of TRANSFER simply bails out without attempting to
fold anything.  Instead, it gives an ICE (in the middle-end, not in the Fortran
front-end).

debian-gfortran:~/test> more awgrey2.f90
function NumOccurances(string,chr) result(n)
  character(*),intent(in) :: string
  character(1),intent(in) :: chr
!
! return number of occurances of character in given string
!
    n=count(transfer(string,char(1),len(string))==chr)
  return
end

debian-gfortran:~/test> ~/bin-trunk/bin/gfortran awgrey2.f90
awgrey2.f90: In function 'numoccurances':
awgrey2.f90:1: internal compiler error: in fold_binary, at fold-const.c:8999
Please submit a full bug report,

debian-gfortran:~/test> ~/bin-trunk/bin/gfortran --version
GNU Fortran (GCC) 4.3.0 20070307 (experimental)


-- 
           Summary: ICE on count(transfer(...)...), with non-constant
                    transfer arguments.
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: brooks at gcc dot gnu dot org
 GCC build triplet: i686-pc-linux-gnu


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


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

end of thread, other threads:[~2007-03-29 16:11 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-03-16  4:38 [Bug fortran/31193] New: ICE on count(transfer(...)...), with non-constant transfer arguments brooks at gcc dot gnu dot org
2007-03-16  6:54 ` [Bug fortran/31193] ICE on non-constant character tranfert fxcoudert at gcc dot gnu dot org
2007-03-21 15:22 ` pault at gcc dot gnu dot org
2007-03-22 13:31 ` patchapp at dberlin dot org
2007-03-22 18:37 ` pault at gcc dot gnu dot org
2007-03-27  9:09 ` [Bug fortran/31193] [4.2 only] " pault at gcc dot gnu dot org
2007-03-29 16:11 ` 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).