This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, Fortran, OOP] PR 44962: [OOP] ICE with specification expression SIZE(<CLASS>)
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
> > 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
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?