iresolve.c and convert type

Thomas Koenig Thomas.Koenig@online.de
Wed Nov 1 11:28:00 GMT 2006


On Wed, Nov 01, 2006 at 11:33:27AM +0100, Tobias Burnus wrote:

> Question two:
> If the type of the library routine is not the same as the passed
> argument, I need to convert it:
> 
> gfc_convert_type (c->ext.actual->expr, &ts, 2);
> c->resolved_sym = gfc_get_intrinsic_sub_symbol (PREFIX("system_clock"));
> 
> So far so good; this produces:
>   {
>     int8 D.1325;
>     D.1325 = (int8) i4;
>     _gfortran_system_clock (&D.1325, 0B, 0B);
>   }
> 
> But how do I create a line which does:
>     i4 = (int4) D.1325;
> I somehow fail to completely digest what gfc_code contains where.

I'm on shaky ground here (not being a front end guru :-), but
I think, for this case, you need to create the new variable "by
hand", using gfc_create_var, and then do the assignments yourself,
using gfc_add_modify_expr.

HTH
	Thomas



More information about the Fortran mailing list