http://gcc.gnu.org/bugzilla/show_bug.cgi?id=46974
--- Comment #3 from Steve Kargl <sgk at troutmask dot apl.washington.edu>
2010-12-18 06:45:19 UTC ---
On Sat, Dec 18, 2010 at 12:01:13AM +0000, sgk at troutmask dot
apl.washington.edu wrote:
>
> Index: simplify.c
> ===================================================================
> --- simplify.c (revision 167949)
> +++ simplify.c (working copy)
> @@ -5954,6 +5954,11 @@ gfc_simplify_transfer (gfc_expr *source,
> if (source->expr_type == EXPR_FUNCTION)
> return NULL;
>
> + if ((mold->expr_type == EXPR_VARIABLE || mold->expr_type == EXPR_STRUCTURE)
> + && mold->ts.type == BT_DERIVED && mold->ts.u.derived
> + && strcmp(mold->ts.u.derived->name, "c_ptr") == 0)
> + return NULL;
> +
> /* Calculate the size of the source. */
> if (source->expr_type == EXPR_ARRAY
> && gfc_array_size (source, &tmp) == FAILURE)
Updated patch to hand C_FUNPTR types.
Index: simplify.c
===================================================================
--- simplify.c (revision 167949)
+++ simplify.c (working copy)
@@ -5954,6 +5954,12 @@ gfc_simplify_transfer (gfc_expr *source,
if (source->expr_type == EXPR_FUNCTION)
return NULL;
+ if ((mold->expr_type == EXPR_VARIABLE || mold->expr_type == EXPR_STRUCTURE)
+ && mold->ts.type == BT_DERIVED && mold->ts.u.derived
+ && (strcmp(mold->ts.u.derived->name, "c_ptr") == 0
+ || strcmp(mold->ts.u.derived->name, "c_funptr") == 0))
+ return NULL;
+
/* Calculate the size of the source. */
if (source->expr_type == EXPR_ARRAY
&& gfc_array_size (source, &tmp) == FAILURE)
I suspect there may be problems with arrays and/or functions that
use these derived types.