From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4846 invoked by alias); 28 Jun 2006 22:00:59 -0000 Received: (qmail 4782 invoked by uid 48); 28 Jun 2006 22:00:51 -0000 Date: Wed, 28 Jun 2006 22:30:00 -0000 Message-ID: <20060628220051.4781.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug fortran/28167] ICE: in fold_binary, at fold-const.c:8239 (temporary character array?) In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pault at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2006-06/txt/msg02466.txt.bz2 List-Id: ------- Comment #4 from pault at gcc dot gnu dot org 2006-06-28 22:00 ------- Created an attachment (id=11776) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11776&action=view) Fixes the problem and some The attached patch fixes the PR and fixes character valued functions in array constructors. This works: character(4), dimension(4) :: c1, c2 integer m m = 4 ! Test the original problem call foo ((/( 'a',i=1,m )/), c2) if (any(c2(:)(1:1) .ne. (/'a','a','a','a'/))) call abort () ! Now get a bit smarter call foo ((/"abcd", "efgh", "ijkl", "mnop"/), c1) ! worked before call foo ((/(c1(i), i = m,1,-1)/), c2) ! was broken if (any(c2(4:1:-1) .ne. c1)) call abort () ! gfc_todo: Not Implemented: complex character array constructors ! call foo ((/(c1(i)(2:3), i = 1,4)/), c2) ! Check functions in the constructor call foo ((/(achar(64+i)//achar(68+i)//achar(72+i)// & achar(76+i),i=1,4 )/), c1) ! was broken if (any (c1 .ne. (/"AEIM","BFJN","CGKO","DHLP"/))) call abort () contains subroutine foo (chr1, chr2) character(*), dimension(:) :: chr1, chr2 chr2 = chr1 end subroutine foo end Paul PS Do not worry - I had not forgotten PR28174! -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28167