public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/28068]  New: Non-standard intrinsics should be documented
@ 2006-06-16 23:47 gay at sfu dot ca
  2006-06-16 23:51 ` [Bug fortran/28068] " pinskia at gcc dot gnu dot org
                   ` (11 more replies)
  0 siblings, 12 replies; 13+ messages in thread
From: gay at sfu dot ca @ 2006-06-16 23:47 UTC (permalink / raw)
  To: gcc-bugs

Recently an ancient program failed to compile because it had a subroutine named
perror. This led to confusing diagnostics about number of arguments. The
problem was fixed by appropriate insertion of EXTERNAL statements.

gfortran appears to define an intrinsic named perror, but this fact is not
documented anywhere that I can see. I suspect there may be other hidden
non-standard intrinsics.

THESE SHOULD BE DOCUMENTED. A lot of time can be wasted tripping over stuff
like this. It would also be nice to have a compiler parameter to turn off
non-standard intrinsics.


-- 
           Summary: Non-standard intrinsics should be documented
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gay at sfu dot ca


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
@ 2006-06-16 23:51 ` pinskia at gcc dot gnu dot org
  2006-06-16 23:54 ` pinskia at gcc dot gnu dot org
                   ` (10 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-16 23:51 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pinskia at gcc dot gnu dot org  2006-06-16 23:47 -------
perror is an old g77 intrinsics.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
  2006-06-16 23:51 ` [Bug fortran/28068] " pinskia at gcc dot gnu dot org
@ 2006-06-16 23:54 ` pinskia at gcc dot gnu dot org
  2006-06-17  2:08 ` kargl at gcc dot gnu dot org
                   ` (9 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-06-16 23:54 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pinskia at gcc dot gnu dot org  2006-06-16 23:51 -------
Confirmed.
perror was added by:
2005-03-22  Francois-Xavier Coudert  <coudert@clipper.ens.fr>

        * check.c (gfc_check_chdir, gfc_check_chdir_sub, gfc_check_kill,
        gfc_check_kill_sub, gfc_check_link, gfc_check_link_sub,
        gfc_check_symlnk, gfc_check_symlnk_sub, gfc_check_rename,
        gfc_check_rename_sub, gfc_check_sleep_sub, gfc_check_gerror,
        gfc_check_getlog, gfc_check_hostnm, gfc_check_hostnm_sub,
        gfc_check_perror): new functions to check newly implemented
        g77 intrinsics.


-- 

pinskia 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
           Keywords|                            |documentation
   Last reconfirmed|0000-00-00 00:00:00         |2006-06-16 23:51:33
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
  2006-06-16 23:51 ` [Bug fortran/28068] " pinskia at gcc dot gnu dot org
  2006-06-16 23:54 ` pinskia at gcc dot gnu dot org
@ 2006-06-17  2:08 ` kargl at gcc dot gnu dot org
  2006-07-28  8:53 ` fxcoudert at gcc dot gnu dot org
                   ` (8 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: kargl at gcc dot gnu dot org @ 2006-06-17  2:08 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from kargl at gcc dot gnu dot org  2006-06-17 02:06 -------
See the first two sentences in Section 8 of gfortran.info.
This is very low hanging fruit, and is placed way below 
fixing actual bugs.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (2 preceding siblings ...)
  2006-06-17  2:08 ` kargl at gcc dot gnu dot org
@ 2006-07-28  8:53 ` fxcoudert at gcc dot gnu dot org
  2007-03-13  8:11 ` brooks at gcc dot gnu dot org
                   ` (7 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2006-07-28  8:53 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from fxcoudert at gcc dot gnu dot org  2006-07-28 08:53 -------
(In reply to comment #0)
> It would also be nice to have a compiler parameter to turn off
> non-standard intrinsics.

By the way: the correct option to compile standard code is to use -std=f95.
That will turn off all non-standard things.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (3 preceding siblings ...)
  2006-07-28  8:53 ` fxcoudert at gcc dot gnu dot org
@ 2007-03-13  8:11 ` brooks at gcc dot gnu dot org
  2007-03-13  8:47 ` brooks at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-13  8:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from brooks at gcc dot gnu dot org  2007-03-13 08:11 -------
I believe that all of the nonstandard intrinsics have now been documented in
4.2 and 4.3, and thus I am closing this bug as fixed.


-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (4 preceding siblings ...)
  2007-03-13  8:11 ` brooks at gcc dot gnu dot org
@ 2007-03-13  8:47 ` brooks at gcc dot gnu dot org
  2007-03-13  8:48 ` brooks at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-13  8:47 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #6 from brooks at gcc dot gnu dot org  2007-03-13 08:47 -------
This bug was erroneously closed.  The following intrinsics are undocumented in
4.2:

INT2, SHORT
INT8, LONG

MCLOCK
MCLOCK8

SECOND


The relevant bits of intrinsic.c:

  add_sym_1 ("int2", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
             gfc_check_intconv, gfc_simplify_int2, gfc_resolve_int2,
             a, BT_REAL, dr, REQUIRED);

  make_alias ("short", GFC_STD_GNU);

  make_generic ("int2", GFC_ISYM_INT2, GFC_STD_GNU);

  add_sym_1 ("int8", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
             gfc_check_intconv, gfc_simplify_int8, gfc_resolve_int8,
             a, BT_REAL, dr, REQUIRED);

  make_generic ("int8", GFC_ISYM_INT8, GFC_STD_GNU);

  add_sym_1 ("long", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
             gfc_check_intconv, gfc_simplify_long, gfc_resolve_long,
             a, BT_REAL, dr, REQUIRED);

  make_generic ("long", GFC_ISYM_LONG, GFC_STD_GNU);

  add_sym_0 ("mclock", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
             NULL, NULL, gfc_resolve_mclock);

  make_generic ("mclock", GFC_ISYM_MCLOCK, GFC_STD_GNU);

  add_sym_0 ("mclock8", ELEMENTAL, ACTUAL_NO, BT_INTEGER, di, GFC_STD_GNU,
             NULL, NULL, gfc_resolve_mclock8);

  make_generic ("mclock8", GFC_ISYM_MCLOCK8, GFC_STD_GNU);

  add_sym_0 ("second", NOT_ELEMENTAL, ACTUAL_NO, BT_REAL, 4, GFC_STD_GNU,
             NULL, NULL, NULL);

  make_generic ("second", GFC_ISYM_SECOND, GFC_STD_GNU);


-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (5 preceding siblings ...)
  2007-03-13  8:47 ` brooks at gcc dot gnu dot org
@ 2007-03-13  8:48 ` brooks at gcc dot gnu dot org
  2007-03-13  9:00 ` brooks at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-13  8:48 UTC (permalink / raw)
  To: gcc-bugs



-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |brooks at gcc dot gnu dot
                   |dot org                     |org
             Status|REOPENED                    |ASSIGNED
   Last reconfirmed|2006-06-16 23:51:33         |2007-03-13 08:48:06
               date|                            |


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (6 preceding siblings ...)
  2007-03-13  8:48 ` brooks at gcc dot gnu dot org
@ 2007-03-13  9:00 ` brooks at gcc dot gnu dot org
  2007-03-13  9:16 ` brooks at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-13  9:00 UTC (permalink / raw)
  To: gcc-bugs



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


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (7 preceding siblings ...)
  2007-03-13  9:00 ` brooks at gcc dot gnu dot org
@ 2007-03-13  9:16 ` brooks at gcc dot gnu dot org
  2007-03-14  2:43 ` brooks at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-13  9:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #8 from brooks at gcc dot gnu dot org  2007-03-13 09:15 -------
Relevant parts of libgfortran/clock.c:

GFC_INTEGER_4
mclock (void)
{
#ifdef HAVE_CLOCK
  return (GFC_INTEGER_4) clock ();
#else
  return (GFC_INTEGER_4) -1;
#endif
}

GFC_INTEGER_8
mclock8 (void)
{
#ifdef HAVE_CLOCK
  return (GFC_INTEGER_8) clock ();
#else
  return (GFC_INTEGER_8) -1;
#endif


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (8 preceding siblings ...)
  2007-03-13  9:16 ` brooks at gcc dot gnu dot org
@ 2007-03-14  2:43 ` brooks at gcc dot gnu dot org
  2007-03-14  2:45 ` brooks at gcc dot gnu dot org
  2007-03-14  2:46 ` brooks at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-14  2:43 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #9 from brooks at gcc dot gnu dot org  2007-03-14 02:43 -------
Subject: Bug 28068

Author: brooks
Date: Wed Mar 14 02:43:27 2007
New Revision: 122902

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122902
Log:
PR fortran/28068
* intrinsic.texi: General whitespace cleanup, remove
comment about missing intrinsics.
(menu): Add lines for new entries listed below.
(ACOSH): Mention specific function DACOSH, correct
description phrasing.
(ASINH): Mention specific function DASINH, correct
description phrasing.
(ATANH): Mention specific function DATANH, correct
description phrasing.
(COS): Add index entry for CCOS.
(CPU_TIME): Correct "REAL" to "REAL(*)".
(EXP): Add index entry for CEXP.
(INT): Correct argument name to "A".
(INT2): New entry.
(INT8): New entry.
(LONG): New entry.
(MAX): Add index entries for specific variants.
(MCLOCK): New entry.
(MCLOCK8): New entry.
(SECNDS): Adjust to a more standard form.
(SECOND): New entry.
(TIME): Add cross-reference to MCLOCK.
(TIME8): Add cross-reference to MCLOCK8.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/intrinsic.texi


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (9 preceding siblings ...)
  2007-03-14  2:43 ` brooks at gcc dot gnu dot org
@ 2007-03-14  2:45 ` brooks at gcc dot gnu dot org
  2007-03-14  2:46 ` brooks at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-14  2:45 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #10 from brooks at gcc dot gnu dot org  2007-03-14 02:45 -------
Subject: Bug 28068

Author: brooks
Date: Wed Mar 14 02:45:14 2007
New Revision: 122903

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=122903
Log:
PR fortran/28068
* intrinsic.texi: General whitespace cleanup, remove
comment about missing intrinsics.
(menu): Add lines for new entries listed below.
(ACOSH): Mention specific function DACOSH, correct
description phrasing.
(ASINH): Mention specific function DASINH, correct
description phrasing.
(ATANH): Mention specific function DATANH, correct
description phrasing.
(COS): Add index entry for CCOS.
(CPU_TIME): Correct "REAL" to "REAL(*)".
(EXP): Add index entry for CEXP.
(INT): Correct argument name to "A".
(INT2): New entry.
(INT8): New entry.
(LONG): New entry.
(MAX): Add index entries for specific variants.
(MCLOCK): New entry.
(MCLOCK8): New entry.
(SECNDS): Adjust to a more standard form.
(SECOND): New entry.
(TIME): Add cross-reference to MCLOCK.
(TIME8): Add cross-reference to MCLOCK8.

Modified:
    branches/gcc-4_2-branch/gcc/fortran/ChangeLog
    branches/gcc-4_2-branch/gcc/fortran/intrinsic.texi


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

* [Bug fortran/28068] Non-standard intrinsics should be documented
  2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
                   ` (10 preceding siblings ...)
  2007-03-14  2:45 ` brooks at gcc dot gnu dot org
@ 2007-03-14  2:46 ` brooks at gcc dot gnu dot org
  11 siblings, 0 replies; 13+ messages in thread
From: brooks at gcc dot gnu dot org @ 2007-03-14  2:46 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #11 from brooks at gcc dot gnu dot org  2007-03-14 02:46 -------
_Now_ this is fixed on 4.2 and trunk.  :)


-- 

brooks at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28068


^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2007-03-14  2:46 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-06-16 23:47 [Bug fortran/28068] New: Non-standard intrinsics should be documented gay at sfu dot ca
2006-06-16 23:51 ` [Bug fortran/28068] " pinskia at gcc dot gnu dot org
2006-06-16 23:54 ` pinskia at gcc dot gnu dot org
2006-06-17  2:08 ` kargl at gcc dot gnu dot org
2006-07-28  8:53 ` fxcoudert at gcc dot gnu dot org
2007-03-13  8:11 ` brooks at gcc dot gnu dot org
2007-03-13  8:47 ` brooks at gcc dot gnu dot org
2007-03-13  8:48 ` brooks at gcc dot gnu dot org
2007-03-13  9:00 ` brooks at gcc dot gnu dot org
2007-03-13  9:16 ` brooks at gcc dot gnu dot org
2007-03-14  2:43 ` brooks at gcc dot gnu dot org
2007-03-14  2:45 ` brooks at gcc dot gnu dot org
2007-03-14  2:46 ` brooks at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).