* [patch, Fortran, committed] Fix PR 50004
@ 2011-08-06 15:57 Thomas Koenig
0 siblings, 0 replies; only message in thread
From: Thomas Koenig @ 2011-08-06 15:57 UTC (permalink / raw)
To: fortran, gcc-patches
[-- Attachment #1: Type: text/plain, Size: 543 bytes --]
Hello world,
I have committed the attached patch as obvious after regression-testing.
The problem was that gfc_typenode_for_spec was clobbering the typespec
for the ISO C types by converting them to integer.
Don't know why I hadn't seen this before.
Regards
Thomas
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.
[-- Attachment #2: p1.diff --]
[-- Type: text/x-patch, Size: 1279 bytes --]
Index: target-memory.c
===================================================================
--- target-memory.c (Revision 177487)
+++ target-memory.c (Arbeitskopie)
@@ -120,8 +120,14 @@ gfc_target_expr_size (gfc_expr *e)
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;
Index: simplify.c
===================================================================
--- simplify.c (Revision 177487)
+++ simplify.c (Arbeitskopie)
@@ -6048,8 +6048,6 @@ gfc_simplify_transfer (gfc_expr *source, gfc_expr
&& 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);
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-08-06 15:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-06 15:57 [patch, Fortran, committed] Fix PR 50004 Thomas Koenig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).