public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Tobias Burnus <burnus@net-b.de>
To: Janus Weil <janus@gcc.gnu.org>
Cc: gfortran <fortran@gcc.gnu.org>, gcc-patches <gcc-patches@gcc.gnu.org>
Subject: Re: [Patch, Fortran, OOP] PR 44962: [OOP] ICE with specification 	expression SIZE(<CLASS>)
Date: Tue, 20 Jul 2010 21:39:00 -0000	[thread overview]
Message-ID: <4C461784.5020801@net-b.de> (raw)
In-Reply-To: <AANLkTikqPGiqzXRyG6BtQGH4X_Bsc5yR6RQQdvDbjLxg@mail.gmail.com>

Janus Weil wrote:

> 2010-07-18  Janus Weil  <janus@gcc.gnu.org>
>
> 	PR fortran/44962
> 	* array.c (resolve_array_bound): Modify error message.
> 	* resolve.c (resolve_fl_derived): Call gfc_resolve_array_spec.
>   
These two changes are OK.

> 	* expr.c (gfc_is_constant_expr): Detect RAND() and IRAND() as
> 	non-constant.
>
> 3) In gfc_is_constant_expr, I'm adding a special case for the RAND()
> and IRAND() intrinsic functions, which were detected to be constant
> before. [I'm assuming that a "constant expression" is something that
> can be reduced to a constant at compile time, which the random
> functions are clearly not.]
>   

Frankly, I do not quite understand the check. I know

a) "initialization expressions", which in Fortran 90 and 2008 are called
"constant expressions", i.e. something which can be reduced at compile
time to a number or string (or an array (constructor) of those).
b) "Specification expressions", which do not need to be constant, but
which need to fulfil some criteria (pureness etc.)

Howver, I have not quite understood how this maps to expr.c's
init/restricted/specification/constant expressions.

Especially, I would expect that gfc_is_constant_expr match an expression
yielding a constant. However, this does not seem to be the case as
specification expressions are allowed. The check for intrinsic functions
I also do not understand. The comment states that a simplified
expression is required. However, if the intrinsic can be simplified,
only has a simple number - and no EXPR_FUNCTION any more. And if not,
well, then the check of the arguments does also not help.

Tobias


  parent reply	other threads:[~2010-07-20 21:39 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-18 16:36 Janus Weil
2010-07-18 17:28 ` Steve Kargl
2010-07-18 17:55   ` Janus Weil
2010-07-18 18:46     ` Steve Kargl
2010-07-18 19:00       ` Janus Weil
2010-07-20 21:39 ` Tobias Burnus [this message]
2010-07-21 21:23   ` Janus Weil
2010-07-21 22:20     ` Janus Weil
2010-07-21 22:48     ` Tobias Burnus
2010-07-22 20:58       ` Janus Weil
2010-07-23 11:37         ` Janus Weil
2010-07-26  6:15         ` Tobias Burnus
2010-07-29 20:18           ` Janus Weil
2010-07-29 21:07             ` Janus Weil
2010-07-18 18:54 Dominique Dhumieres
2010-07-26  7:20 Dominique Dhumieres

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=4C461784.5020801@net-b.de \
    --to=burnus@net-b.de \
    --cc=fortran@gcc.gnu.org \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=janus@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).