This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug fortran/46638] Wrong result with TRANSFER from string to DT


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

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> 2010-11-24 09:56:26 UTC ---
Patch:

diff --git a/gcc/fortran/target-memory.c b/gcc/fortran/target-memory.c
index 93e1c8c..1bca1dd 100644
--- a/gcc/fortran/target-memory.c
+++ b/gcc/fortran/target-memory.c
@@ -477,7 +477,8 @@ gfc_interpret_derived (unsigned char *buffer, size_t
buffer_size, gfc_expr *resu
       /* The constructor points to the component.  */
       c->n.component = cmp;

-      ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl));
+      ptr = TREE_INT_CST_LOW (DECL_FIELD_OFFSET (cmp->backend_decl))
+           + TREE_INT_CST_LOW (DECL_FIELD_BIT_OFFSET (cmp->backend_decl))/8;
       gfc_target_interpret_expr (&buffer[ptr], buffer_size - ptr, e);
     }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]