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/34199] segfault for TRANSFER integer to TYPE(C_PTR)



------- 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


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