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] PR31219 - ICE on array of character function results


:ADDPATCH fortran:

This problem was caused by the character length of a procedure result
being used for an array constructor character length.  If this were
not constant, an ICE would ensue because the function result is out of
scope.  Instead, the function must be called and the string length
calculated by the interface routines in trans-expr.c.  Since the
function call is not required and could produce unwanted side-effects
this is suppressed by a new bitfield in gfc_se.  The testcase is the
reporter's.

Regtested on FC5/x86_ia64 - OK for trunk?

Thanks for the report, Jost.

Paul

2007-05-23 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/31219
	* trans.h : Add no_function_call bitfield to gfc_se structure.
	Add stmtblock_t argument to prototype of get_array_ctor_strlen.
	* trans-array.c (get_array_ctor_all_strlen): New function.
	(get_array_ctor_strlen): Add new stmtblock_t argument and call
	new function for character elements that are not constants,
	arrays or variables.
	* trans-intrinsic (gfc_conv_intrinsic_len): Add new argument
	to call of get_array_ctor_strlen.

2007-05-23 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/31219
	* gfortran.dg/array_constructor_17.f90: New test.

Attachment: pr31219.diff
Description: Text document


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