This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Attachment: pr44962_v2.diff
Description: Binary data

Attachment: typebound_proc_17.f03
Description: Binary data


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]