[patch, fortran] PR33317 CSHIFT/EOSHIFT: Rejects optional dummy for DIM=

Jerry DeLisle jvdelisle@verizon.net
Sun Nov 18 07:21:00 GMT 2007


:ADDPATCH fortran:

This patch fixes this bug by enabling the DIM argument for these two functions 
in their respective check routines.

Then in resolve.c, the DIM argument is marked so that later in 
trans-intrinsic.c, the type can be cast to the default integer size so that it 
matches with the respective runtime library function.

The previous insertion of the type conversion was messing up the translation 
causing a segfault when a NULL (DIM argument not present) in the calling routine 
optional argument was not present.  See test case for example.

Also fixed up some white space problems found along the way.

Regression tested on x86-64.  OK for trunk?

Jerry

2007-11-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

	* trans-expr.c (gfc_conv_missing_dummy): Set the type of the dummy
	argument to default integer if flagged to do so. Fix typo in comment.
	* resolve.c (gfc_resolve_dim_arg): Whitespace cleanup.
	* iresolve.c (gfc_resolve_cshift): Do not convert type, mark attribute
	for converting the DIM type appropriately in trans-expr.c.
	(gfc_resolve_eoshift): Likewise.
	* check.c (dim_check): Remove pre-existing dead code.
	(gfc_check_cshift): Enable dim_check to allow DIM as an optional.
	(gfc_check_eoshift): Likewise.
	* trans_intrinsic.c (gfc_conv_intrinsic_function_args): Fix whitespace.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr33317.diff
Type: text/x-patch
Size: 6583 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071118/09e3ad7f/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: optional_dim_2.f90
Type: text/x-fortran
Size: 805 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20071118/09e3ad7f/attachment-0001.bin>


More information about the Fortran mailing list