public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Steve Kargl <sgk@troutmask.apl.washington.edu>
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: Sun, 18 Jul 2010 18:46:00 -0000	[thread overview]
Message-ID: <20100718184559.GA27842@troutmask.apl.washington.edu> (raw)
In-Reply-To: <AANLkTilckxP8pWuuZlBb5tED4jdWOdsHzNqSetjQ8eJ-@mail.gmail.com>

On Sun, Jul 18, 2010 at 07:55:13PM +0200, Janus Weil wrote:
> Hi Steve,
> 
> >> 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.]
> >
> > I think that this part is the wrong way to address the issue.
> 
> what do you think would be a better way?

I don't know, yet.  But, special casing these two intrinsics
in gfc_is_constant_expr seems wrong.  With hundreds of intrinsics
procedures, are these the only 2 that need this special handling?
If yes, then why?  If no, then we need to add special casing for
all intrinsics.

> > In looking at intrinsics.c, I see that neither rand nor irand
> > have simplification procedures.
> 
> Of course not. How could they? They will not be simplifyable at
> compile time in any way ...

Sorry, misread your comment.  I was thinking about something
like 'i = irand(j)' verseus 'i = irand(23)' where the argument
is optional.

With the toy programs I've written this morning involving rand(),
f951 never enter gfc_is_constant_expr().  Do you have a small
example that exhibits this problem?

-- 
Steve

  reply	other threads:[~2010-07-18 18:46 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 [this message]
2010-07-18 19:00       ` Janus Weil
2010-07-20 21:39 ` Tobias Burnus
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=20100718184559.GA27842@troutmask.apl.washington.edu \
    --to=sgk@troutmask.apl.washington.edu \
    --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).