re PR fortran/32600 ([ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function)
2007-07-19 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32600 * trans-expr.c (gfc_conv_function_call): Inline C_LOC. 2007-07-19 Christopher D. Rickett <crickett@lanl.gov> PR fortran/32600 * libgfortran/intrinsics/iso_c_binding.c: Remove C_LOC. * libgfortran/intrinsics/iso_c_binding.h: Ditto. * libgfortran/gfortran.map: Ditto. From-SVN: r126744
This commit is contained in:
parent
2211d9eae7
commit
972345f2c9
6 changed files with 39 additions and 19 deletions
|
@ -1,3 +1,8 @@
|
|||
2007-07-19 Christopher D. Rickett <crickett@lanl.gov>
|
||||
|
||||
PR fortran/32600
|
||||
* trans-expr.c (gfc_conv_function_call): Inline C_LOC.
|
||||
|
||||
2007-07-18 Christopher D. Rickett <crickett@lanl.gov>
|
||||
|
||||
PR fortran/32801
|
||||
|
|
|
@ -2060,6 +2060,33 @@ gfc_conv_function_call (gfc_se * se, gfc_symbol * sym,
|
|||
var = NULL_TREE;
|
||||
len = NULL_TREE;
|
||||
|
||||
if (sym->from_intmod == INTMOD_ISO_C_BINDING
|
||||
&& sym->intmod_sym_id == ISOCBINDING_LOC)
|
||||
{
|
||||
if (arg->expr->rank == 0)
|
||||
{
|
||||
gfc_conv_expr_reference (se, arg->expr);
|
||||
}
|
||||
else
|
||||
{
|
||||
int f;
|
||||
/* This is really the actual arg because no formal arglist is
|
||||
created for C_LOC. */
|
||||
fsym = arg->expr->symtree->n.sym;
|
||||
|
||||
/* We should want it to do g77 calling convention. */
|
||||
f = (fsym != NULL)
|
||||
&& !(fsym->attr.pointer || fsym->attr.allocatable)
|
||||
&& fsym->as->type != AS_ASSUMED_SHAPE;
|
||||
f = f || !sym->attr.always_explicit;
|
||||
|
||||
argss = gfc_walk_expr (arg->expr);
|
||||
gfc_conv_array_parameter (se, arg->expr, argss, f);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (se->ss != NULL)
|
||||
{
|
||||
if (!sym->attr.elemental)
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
2007-07-19 Christopher D. Rickett <crickett@lanl.gov>
|
||||
|
||||
PR fortran/32600
|
||||
* libgfortran/intrinsics/iso_c_binding.c: Remove C_LOC.
|
||||
* libgfortran/intrinsics/iso_c_binding.h: Ditto.
|
||||
* libgfortran/gfortran.map: Ditto.
|
||||
|
||||
2007-07-15 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
|
||||
|
||||
|
|
|
@ -1019,7 +1019,6 @@ GFORTRAN_1.0 {
|
|||
__iso_c_binding_c_f_pointer_u0;
|
||||
__iso_c_binding_c_f_procpointer;
|
||||
__iso_c_binding_c_funloc;
|
||||
__iso_c_binding_c_loc;
|
||||
local:
|
||||
*;
|
||||
};
|
||||
|
|
|
@ -213,23 +213,6 @@ ISO_C_BINDING_PREFIX (c_associated_2) (void *c_ptr_in_1, void *c_ptr_in_2)
|
|||
}
|
||||
|
||||
|
||||
/* Return the C address of the given Fortran allocatable object. */
|
||||
|
||||
void *
|
||||
ISO_C_BINDING_PREFIX (c_loc) (void *f90_obj)
|
||||
{
|
||||
if (f90_obj == NULL)
|
||||
{
|
||||
runtime_error ("C_LOC: Attempt to get C address for Fortran object"
|
||||
" that has not been allocated or associated");
|
||||
abort ();
|
||||
}
|
||||
|
||||
/* The "C" address should be the address of the object in Fortran. */
|
||||
return f90_obj;
|
||||
}
|
||||
|
||||
|
||||
/* Return the C address of the given Fortran procedure. This
|
||||
routine is expected to return a derived type of type C_FUNPTR,
|
||||
which represents the C address of the given Fortran object. */
|
||||
|
|
|
@ -64,7 +64,6 @@ void ISO_C_BINDING_PREFIX(c_f_pointer_u0) (void *, gfc_array_void *,
|
|||
void ISO_C_BINDING_PREFIX(c_f_pointer_d0) (void *, gfc_array_void *,
|
||||
const array_t *);
|
||||
|
||||
void *ISO_C_BINDING_PREFIX(c_loc) (void *);
|
||||
void *ISO_C_BINDING_PREFIX(c_funloc) (void *);
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue