[Bug fortran/32689] [4.3 regression] TRANSFER returns scalar, even if MOLD is an array

pault at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Mon Jul 9 21:33:00 GMT 2007



------- Comment #2 from pault at gcc dot gnu dot org  2007-07-09 21:33 -------
(In reply to comment #1)

How wierd and wonderful - whilst it is a regression, it is only just; given the
timing of gfc_array_transfer and gfc_simplify_transfer, the latter undid the
former by only a few months or so:)

Really galling is that Brooks and I missed this case and that the fix is so
very easy *sigh*

Index: gcc/fortran/simplify.c
===================================================================
*** gcc/fortran/simplify.c      (revision 126461)
--- gcc/fortran/simplify.c      (working copy)
*************** gfc_simplify_transfer (gfc_expr *source,
*** 3924,3930 ****

    /* Set the number of elements in the result, and determine its size.  */
    result_elt_size = gfc_target_expr_size (mold_element);
!   if (mold->expr_type == EXPR_ARRAY || size)
      {
        int result_length;

--- 3924,3930 ----

    /* Set the number of elements in the result, and determine its size.  */
    result_elt_size = gfc_target_expr_size (mold_element);
!   if (mold->expr_type == EXPR_ARRAY || mold->rank || size)
      {
        int result_length;

I will commit this tomorrow morning, with two other "obvious" patches, after
regtesting.

Paul


-- 

pault at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pault at gcc dot gnu dot org
                   |dot org                     |
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-07-09 09:10:41         |2007-07-09 21:33:26
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32689



More information about the Gcc-bugs mailing list