From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6406 invoked by alias); 11 Jun 2005 13:49:07 -0000 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 Received: (qmail 6395 invoked by alias); 11 Jun 2005 13:49:04 -0000 Date: Sat, 11 Jun 2005 13:49:00 -0000 Message-ID: <20050611134904.6393.qmail@sourceware.org> From: "sgk at troutmask dot apl dot washington dot edu" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050212162405.19926.sgk@troutmask.apl.washington.edu> References: <20050212162405.19926.sgk@troutmask.apl.washington.edu> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug fortran/19926] Incorrect rank with PARAMETER and array element. X-Bugzilla-Reason: CC X-SW-Source: 2005-06/txt/msg01538.txt.bz2 List-Id: ------- 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