[Patch, fortran] PR29507 and PR31404 - scalarization in initialization expressions

Paul Richard Thomas paul.richard.thomas@gmail.com
Thu Apr 5 12:01:00 GMT 2007


:ADDPATCH fortran:

This patch is concerned with "scalarizing" elemental, intrinsic
function calls, in initialization expressions, that have array
arguments.  The fix is a straightforward bit of graft that gathers the
arguments and applies the function to them in sequence, simplifying
along the way.  The result is an array, whose elements are the
function values.  Care has to be taken for scalar and missing,
optional arguments.  The shape of the result is assumed to be that of
the first argument and its characteristics those of the original
expression.  The testcase is a combination and expansion of the
reporters'.

A rudimentary test for conformance has been added.
gfc_check_conformance was tried but segfaulted because the expressions
are missing bits and pieces that this function requires.

Regtested on x86_ia64/FC5 - OK for trunk?

Paul

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

	PR fortran/29507
	PR fortran/31404
	* expr.c (scalarize_intrinsic_call): New function to
	scalarize elemental intrinsic functions in initialization
	expressions.
	(check_init_expr): Detect elemental intrinsic functions
	in initalization expressions and call previous.

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

	PR fortran/29507
	PR fortran/31404
	* gfortran.dg/initialization_6.f90: New test.



-- 
Saint Augustine - "O Lord, help me to be pure, but not yet"
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: pr29507.diff
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20070405/a53ebc03/attachment.ksh>


More information about the Gcc-patches mailing list