This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/34199] segfault for TRANSFER integer to TYPE(C_PTR)
- From: "burnus at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 24 Nov 2007 23:02:59 -0000
- Subject: [Bug fortran/34199] segfault for TRANSFER integer to TYPE(C_PTR)
- References: <bug-34199-13404@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #1 from burnus at gcc dot gnu dot org 2007-11-24 23:02 -------
Some debugging notes. While the following crashes
C_NULL_PTR1 = transfer(0_C_INTPTR_T, C_NULL_PTR1)
it works after replacing the constant by a variable.
In gfc_simplify_transfer (for the constant expression),
/* And read the buffer back into the new expression. */
gfc_target_interpret_expr (buffer, buffer_size, result);
is called. Here, "result" is of the type(c_ptr), i.e. ts.type == BT_DERIVED.
As it is not a real derived type calling gfc_interpret_derived fails
(segfault); converting it into INTEGER works in principle, but it fails in the
"C_NULL_PTR1 =" assignment step as one cannot assign an integer to a derived
type.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34199