2011-08-06 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/50004
* target-memory.c (gfc_target_expr-size): Don't clobber typespec
for derived types.
* simplify.c (gfc_simplify_transfer): Don't calculate source_size
twice.
From-SVN: r177527
+2011-08-06 Thomas Koenig <tkoenig@gcc.gnu.org>
+
+ PR fortran/50004
+ * target-memory.c (gfc_target_expr-size): Don't clobber typespec
+ for derived types.
+ * simplify.c (gfc_simplify_transfer): Don't calculate source_size
+ twice.
+
2011-08-05 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/37211
&& gfc_array_size (source, &tmp) == FAILURE)
gfc_internal_error ("Failure getting length of a constant array.");
- source_size = gfc_target_expr_size (source);
-
/* Create an empty new expression with the appropriate characteristics. */
result = gfc_get_constant_expr (mold->ts.type, mold->ts.kind,
&source->where);
case BT_HOLLERITH:
return e->representation.length;
case BT_DERIVED:
- type = gfc_typenode_for_spec (&e->ts);
- return int_size_in_bytes (type);
+ {
+ /* Determine type size without clobbering the typespec for ISO C
+ binding types. */
+ gfc_typespec ts;
+ ts = e->ts;
+ type = gfc_typenode_for_spec (&ts);
+ return int_size_in_bytes (type);
+ }
default:
gfc_internal_error ("Invalid expression in gfc_target_expr_size.");
return 0;