This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug fortran/28068] Non-standard intrinsics should be documented
- From: "brooks at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 13 Mar 2007 09:00:38 -0000
- Subject: [Bug fortran/28068] Non-standard intrinsics should be documented
- References: <bug-28068-9978@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #7 from brooks at gcc dot gnu dot org 2007-03-13 09:00 -------
Relevant pieces of trans-intrinsic.c:
/* Integer conversions are handled separately to make sure we get the
correct rounding mode. */
case GFC_ISYM_INT:
case GFC_ISYM_INT2:
case GFC_ISYM_INT8:
case GFC_ISYM_LONG:
gfc_conv_intrinsic_int (se, expr, FIX_TRUNC_EXPR);
break;
case GFC_ISYM_MCLOCK:
case GFC_ISYM_MCLOCK8:
case GFC_ISYM_SECOND:
gfc_conv_intrinsic_funcall (se, expr);
break;
Relevant bits of iresolve.c:
void
gfc_resolve_int2 (gfc_expr * f, gfc_expr * a)
{
f->ts.type = BT_INTEGER;
f->ts.kind = 2;
f->value.function.name =
gfc_get_string ("__int_%d_%c%d", f->ts.kind, gfc_type_letter (a->ts.type),
a->ts.kind);
}
void
gfc_resolve_int8 (gfc_expr * f, gfc_expr * a)
{
f->ts.type = BT_INTEGER;
f->ts.kind = 8;
f->value.function.name =
gfc_get_string ("__int_%d_%c%d", f->ts.kind, gfc_type_letter (a->ts.type),
a->ts.kind);
}
void
gfc_resolve_long (gfc_expr * f, gfc_expr * a)
{
f->ts.type = BT_INTEGER;
f->ts.kind = 4;
f->value.function.name =
gfc_get_string ("__int_%d_%c%d", f->ts.kind, gfc_type_letter (a->ts.type),
a->ts.kind);
}
void
gfc_resolve_mclock (gfc_expr * f)
{
f->ts.type = BT_INTEGER;
f->ts.kind = 4;
f->value.function.name = PREFIX("mclock");
}
void
gfc_resolve_mclock8 (gfc_expr * f)
{
f->ts.type = BT_INTEGER;
f->ts.kind = 8;
f->value.function.name = PREFIX("mclock8");
}
/* G77 compatibility subroutine second(). */
void
gfc_resolve_second_sub (gfc_code * c)
{
const char *name;
name = gfc_get_string (PREFIX("second_sub"));
c->resolved_sym = gfc_get_intrinsic_sub_symbol (name);
}
Relevant part of intrinsics/cpu_time.c:
void
second_sub (GFC_REAL_4 *s)
{
cpu_time_4 (s);
}
extern GFC_REAL_4 second (void);
export_proto(second);
GFC_REAL_4
second (void)
{
GFC_REAL_4 s;
cpu_time_4 (&s);
return s;
}
Note that cpu_time_4 is the kind=4 variant of CPU_TIME.
--
brooks at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |brooks at gcc dot gnu dot
| |org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068