------- Comment #5 from fxcoudert at gcc dot gnu dot org 2008-02-14 12:42
-------
I've posted a workaround patch at
http://gcc.gnu.org/ml/fortran/2008-02/msg00092.html. My analysis is currently
as follow: we currently have
static void * * C.906 = &argv;
glutinit_gl (&C.906);
which leads to the ICE in expand_expr_addr_expr_1(). The code we emitted
before, when C_LOC wasn't inlined, was:
void * C.906 = _gfortran_c_loc (&argv);
glutinit_gl (&C.906);
where _gfortran_c_loc was effectively:
void * _gfortran_c_loc (void *p) { return p; }
As Tobias shown, the code taking care of taking the adress of argv
(constructing "&argv") is in function gfc_conv_function_call (in trans-expr.c).
I have tried to modify it by forcing a cast to pvoid_type_node, but it still
gets the "static" attribute later. The variable creation is not done in that
function, but later (and I cannot see why). If someone knows where, that would
be great.
PS: I think that translating the ISO_C_BINDING inlined functions in
gfc_conv_function_call() is actually too late. The intrinsic functions, for
example, are intercepted somewhere earlier in the code path, and I think that
would be better to do it in a similar way for intrinsic module functions (now,
ISO_C_BINDING, and later, IEEE_*).
--
fxcoudert at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |fxcoudert at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Known to fail| |4.3.0
Last reconfirmed|0000-00-00 00:00:00 |2008-02-14 12:42:39
date| |
Target Milestone|--- |4.3.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35150