public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "pault at gcc dot gnu dot org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug fortran/28167] ICE: in fold_binary, at fold-const.c:8239 (temporary character array?)
Date: Wed, 28 Jun 2006 22:30:00 -0000	[thread overview]
Message-ID: <20060628220051.4781.qmail@sourceware.org> (raw)
In-Reply-To: <bug-28167-6318@http.gcc.gnu.org/bugzilla/>



------- 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


  parent reply	other threads:[~2006-06-28 22:00 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-26  7:53 [Bug fortran/28167] New: " anlauf at gmx dot de
2006-06-26  8:24 ` [Bug fortran/28167] " anlauf at gmx dot de
2006-06-26  9:45 ` rguenth at gcc dot gnu dot org
2006-06-27 14:20 ` paul dot richard dot thomas at cea dot fr
2006-06-28 22:30 ` pault at gcc dot gnu dot org [this message]
2006-07-04 20:16 ` pault at gcc dot gnu dot org
2006-07-04 20:36 ` pault at gcc dot gnu dot org
2006-07-06 15:35 ` pault at gcc dot gnu dot org
2006-07-06 15:38 ` pault at gcc dot gnu dot org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20060628220051.4781.qmail@sourceware.org \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).