From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21783 invoked by alias); 16 Mar 2007 04:38:39 -0000 Received: (qmail 21742 invoked by uid 48); 16 Mar 2007 04:38:27 -0000 Date: Fri, 16 Mar 2007 04:38:00 -0000 Subject: [Bug fortran/31193] New: ICE on count(transfer(...)...), with non-constant transfer arguments. X-Bugzilla-Reason: CC Message-ID: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "brooks at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-03/txt/msg01474.txt.bz2 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