This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [PATCH,fortran] Fix PR 31244
- From: FX Coudert <fxcoudert at gmail dot com>
- To: Steve Kargl <sgk at troutmask dot apl dot washington dot edu>
- Cc: fortran at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org
- Date: Fri, 5 Oct 2007 23:51:06 +0100
- Subject: Re: [PATCH,fortran] Fix PR 31244
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; bh=7vxK7MM2yETfTBkTqzAaIK8LHXoQwMi4vjwj5XFJKsw=; b=SGOZFvz9spMh3r2qsPXqI/lxBw7t6wVfynicwF/l1/FXx3ZG4M0D9E+lXoh4D3ZndoM2U0MAHgPuTvs7TGrCw0MC+MNwOBbS1aWPSjGmXF/SvMuVDL90WGKsyx3w+BekKgJSewrTwL9FsUQ98opSguXfaB5yEW8pQcI7bDLoJJ8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:in-reply-to:references:mime-version:content-type:message-id:cc:content-transfer-encoding:from:subject:date:to:x-mailer; b=IIahKBjo9EHaWHaUtdYTBHgAaYeeoHOcCZvVTp90pepuzNhNSTNt6tI+RLLtu9gA0D84MdEBb5fUgHa4qie7rgk4cxNLSd+Hs6DsOWvaMKuOdrbszk5sMWc/tpFUmL7wUmx6lnv2DlrW0zkrwJes3MUp9PclCUQyPE24Wf+Uxl8=
- References: <20070924221122.GA3766@troutmask.apl.washington.edu>
I was clearing my mail backlog, and apparently this patch wasn't
reviewed, sorry Steve!
I had an alternative patch that put a sane limit on
the repeat count and documented this limit in manual.
Personally, I preferred this patch.
Sanity check: you prefer the patch you submitted to the patch adding
a limit, did I get it right?
2007-09-24 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/31244
* decl.c (free_value): Clear mpz value.
(top_val_list): Convert variable from unsigned int to mpz_t.
* gfortran.h (gfc_data_value): Ditto.
* resolve.c (struct values): Ditto
(next_data_value): Use mpz_t variable.
(check_data_variable): Ditto.
(resolve_data): Ditto.
OK, with the following modification:
- signed int tmp;
- msg = gfc_extract_int (expr, &tmp);
+ if (expr->ts.type == BT_INTEGER)
+ mpz_set (tail->repeat, expr->value.integer);
gfc_free_expr (expr);
I think, to be consistent with what gfc_extract_int() did, we should
add a check that the expression is an EXPR_CONSTANT of type
BT_INTEGER, and otherwise call gfc_error(). Maybe this is already
checked somewhere, in which case I've missed it.
Also, a formatting question. In the following, is the blank line
consistent with GCC coding style? (I don't think so, and never put one.)
static void
-resolve_data (gfc_data * d)
+resolve_data (gfc_data *d)
{
+
if (resolve_data_variables (d->var) == FAILURE)
return;
Thanks,
FX