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/16206] rejects valid array initialization expression Date: Thu, 15 Jun 2006 18:07:00 -0000 [thread overview] Message-ID: <20060615173910.20071.qmail@sourceware.org> (raw) In-Reply-To: <bug-16206-6318@http.gcc.gnu.org/bugzilla/> ------- Comment #7 from pault at gcc dot gnu dot org 2006-06-15 17:39 ------- Created an attachment (id=11675) --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=11675&action=view) A near submission level patch for the PR I have not marked the previous version as obsolete because it could well be a valuable chunk of a future patch. The attached fixes most of the cases below, except for the last. Array sections, with variable index expressions, in implicit do loops still give an error; in fact the same error as g95! I think I can see how to do that final tweek.... Paul PS Please excuse the state of these "working" test programs; I use them as labs to test and diagnose the patch. program gfortran_bug1 ! real, parameter :: x(4,4) = reshape((/(i, i = 1, 16)/), (/4,4/)) real, parameter :: xx(2) = (/ 12.0, 14.0 /) real, parameter :: xxx(2) = (/ xx - 3 /) character(4), parameter :: chr(4) = (/"abcd", "efgh", "ijkl", "mnop"/), & scalar = "abcd" character(4), parameter :: scalar2 = chr(1)(2:4) ,chrt(2) = (/chr(2:2)(2:3), chr(3:3)(3:4)/) character(2), parameter :: chrr(2) = chr(2:3)(2:3) character(2), parameter :: chrx(2) = (/(chr(i)(2:3), i=2,3)/) ! ! gfortran dies at the following, which AFAICT is legal: ! real, parameter :: y(4) = (/ x(1:2, 2), x(1:2, 4)/) real, parameter :: z(2) = x(1:2, 1) + 1 print *, x print *, z print *, y print *, xxx print *, chrr print *, chrt print *, scalar2 print *, chrx end program gfortran_bug1 program gfortran_bug2 ! ! character(4), parameter :: chr(4) = (/"abcd", "efgh", "ijkl", "mnop"/), & ! scalar = "abcd" ! character(4), parameter :: chrx(2) = (/(chr(i), i=2,3)/) integer, parameter :: m(4) = (/1,2,3,4/) integer, parameter :: n(2) = (/(m(i), i = 2,3)/) integer, parameter :: o(4) = (/(n, i = 2,3)/) integer, parameter :: q(4) = (/((/(m(j), j = i, i+1)/), i = 2,3)/) integer, parameter :: p(8) = (/(m(i:i+1), i = 1,4)/) ! print *, chrx print *, n, o, p end program gfortran_bug2 -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16206
next prev parent reply other threads:[~2006-06-15 17:39 UTC|newest] Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top [not found] <bug-16206-6318@http.gcc.gnu.org/bugzilla/> 2005-11-24 13:26 ` [Bug fortran/16206] Internal error on " eedelman at gcc dot gnu dot org 2006-05-29 21:22 ` [Bug fortran/16206] rejects valid array " anlauf at gmx dot de 2006-06-06 11:53 ` paul dot richard dot thomas at cea dot fr 2006-06-09 15:36 ` paul dot richard dot thomas at cea dot fr 2006-06-09 19:43 ` pault at gcc dot gnu dot org 2006-06-15 18:07 ` pault at gcc dot gnu dot org [this message] 2006-06-16 8:28 ` anlauf at gmx dot de 2006-06-16 16:24 ` paulthomas2 at wanadoo dot fr 2006-06-20 4:31 ` pault at gcc dot gnu dot org 2006-06-23 4:47 ` pault at gcc dot gnu dot org 2006-06-23 15:42 ` pault at gcc dot gnu dot org 2006-06-29 21:36 ` patchapp at dberlin dot org 2006-07-03 10:35 ` reichelt 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=20060615173910.20071.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: linkBe 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).