[Patch, fortran] PR18769, PR25049 and PR25050 - transformational functions in initialization expressions.

Paul Thomas paulthomas2@wanadoo.fr
Sun Jun 18 01:53:00 GMT 2006


:ADDPATCH fortran:

A number of transformational intrinsic functions are not permitted in 
initialization expressions (please see the standard or the ChangeLog for 
the list).  These are not implemented in simplify.c and, in consequence, 
and ICE ensues on trying to deploy them in initialization expressions.  
This patch detects the incorrect usage in check.c and emits an error 
there.  check.c was chosen because no further selection of intrinsic 
funtions was needed; the usual mechanism applies.

On the other hand, TRANSFER is allowed but is not implemented in 
gfortran (PR18769).  I have added a gfc_simply_transfer as a placeholder 
for its implementation.  At present, it emits an error.  I propose to 
keep the PR open and, since I am in full flood on constructors right 
now, I have assigned it to myself!

I suggest that a testcase is not necessary for this patch, although I 
will provide one for PR18769, when it is fixed.

Regtested on FC5/Athlon.  OK for trunk and 4.1?

Paul

2006-06-18  Paul Thomas  <pault@gcc.gnu.org>

    PR fortran/25049
    PR fortran/25050
    * check.c (non_init_transformational): New function.
    (find_substring_ref): New function to signal use of disallowed
    transformational intrinsic in an initialization expression.
    (gfc_check_all_any): Call previous if initialization expr.
    (gfc_check_count): The same.
    (gfc_check_cshift): The same.
    (gfc_check_dot_product): The same.
    (gfc_check_eoshift): The same.
    (gfc_check_minloc_maxloc): The same.
    (gfc_check_minval_maxval): The same.
    (gfc_check_gfc_check_product_sum): The same.
    (gfc_check_pack): The same.
    (gfc_check_spread): The same.
    (gfc_check_transpose): The same.
    (gfc_check_unpack): The same.

    PR fortran/18769
    *intrinsic.c (add_functions): Add gfc_simplify_transfer.
    *intrinsic.h : Add prototype for gfc_simplify_transfer.
    *simplify.c (gfc_simplify_transfer) : New function to act as
    placeholder for eventual implementation.  Emit error for now.




-------------- next part --------------
A non-text attachment was scrubbed...
Name: submit.diff
Type: text/x-patch
Size: 6131 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060618/771645e7/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Change.Log
Type: text/x-log
Size: 958 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/gcc-patches/attachments/20060618/771645e7/attachment-0001.bin>


More information about the Gcc-patches mailing list