[Patch, Fortran, OOP] PR 44962: [OOP] ICE with specification expression SIZE(<CLASS>)

Janus Weil janus@gcc.gnu.org
Sun Jul 18 16:36:00 GMT 2010


Hi all,

the cause of this PR was that the array spec of a vtype's PPC was not
correctly resolved. The attached patch corrects this and does some
related cleanup in three places:

1) In resolve_fl_derived, I'm replacing a piece of code by a call to
gfc_resolve_array_spec, which should do exactly the same checks. Plus:
It should correctly resolve the array spec for PPCs.

2) In resolve_array_bound, I'm modifying an error message which
assumed that the expression of the array bound is always a variable
(which is clearly wrong and results in an ICE when the expression is
not a variable).

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.]

The patch was regtested on x86_64-unknown-linux-gnu. Ok for trunk?

Cheers,
Janus



2010-07-18  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44962
	* array.c (resolve_array_bound): Modify error message.
	* expr.c (gfc_is_constant_expr): Detect RAND() and IRAND() as
	non-constant.
	* resolve.c (resolve_fl_derived): Call gfc_resolve_array_spec.


2010-07-18  Janus Weil  <janus@gcc.gnu.org>

	PR fortran/44962
	* gfortran.dg/typebound_proc_17.f03: New.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr44962_v2.diff
Type: application/octet-stream
Size: 2722 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100718/8d8aa56b/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: typebound_proc_17.f03
Type: application/octet-stream
Size: 596 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20100718/8d8aa56b/attachment-0001.obj>


More information about the Gcc-patches mailing list