This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/19926] Incorrect rank with PARAMETER and array element.
- From: "sgk at troutmask dot apl dot washington dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Jun 2005 13:49:04 -0000
- Subject: [Bug fortran/19926] Incorrect rank with PARAMETER and array element.
- References: <20050212162405.19926.sgk@troutmask.apl.washington.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From sgk at troutmask dot apl dot washington dot edu 2005-06-11 13:49 -------
Subject: Re: Incorrect rank with PARAMETER and array element.
On Sat, Jun 11, 2005 at 09:39:13AM -0000, eedelman at acclab dot helsinki dot fi wrote:
>
> Just to elaborate on what I meant with suspecting thet the patch only hides the
> problem instead of solving it.
>
> One thing that slightly worries my is, why isn't e->rank zero by itself?
You might be right that this is papering over the true bug.
The code looks like
case FL_PARAMETER:
if (sym->value && sym->value->expr_type != EXPR_ARRAY)
{
e = gfc_copy_expr (sym->value);
e->rank = 0;
}
e = gfc_copy_expr (sym->value) literally copies the sym->value expression
node into the e expression node. sym->value->rank is 1. We've probably
kludged around the bug by setting e->rank = 0. So, how do we get here.
sym->value->expr_type == EXPR_CONSTANT because of PARAMETER in "REAL,
PARAMETER :: map(0:50) = 0". I'll look at this sometime today.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=19926