public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/33387]  New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
@ 2007-09-11  9:54 fxcoudert at gcc dot gnu dot org
  2007-09-11  9:55 ` [Bug fortran/33387] " fxcoudert at gcc dot gnu dot org
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-11  9:54 UTC (permalink / raw)
  To: gcc-bugs

Some Fortran intrinsics, like NEAREST or EXPONENT, are translated into calls to
libgfortran functions, which in turn call C99 functions. We could easily
generate C99 calls directly from the front-end, which would enable further
optimization by the middle-end.

The list of intrinsics I think of for which we can do that is: EXPONENT,
FRACTION, NEAREST, RRSPACING, SET_EXPONENT and SPACING.


-- 
           Summary: Fortran front-end should translate intrinsics by calling
                    C99 function instead of libgfortran functions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: fxcoudert at gcc dot gnu dot org
        ReportedBy: fxcoudert at gcc dot gnu dot org


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
@ 2007-09-11  9:55 ` fxcoudert at gcc dot gnu dot org
  2007-09-11  9:55 ` fxcoudert at gcc dot gnu dot org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-11  9:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2007-09-11 09:54:54
               date|                            |


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
  2007-09-11  9:55 ` [Bug fortran/33387] " fxcoudert at gcc dot gnu dot org
@ 2007-09-11  9:55 ` fxcoudert at gcc dot gnu dot org
  2007-09-11 13:03 ` fxcoudert at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-11  9:55 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |fxcoudert at gcc dot gnu dot
                   |dot org                     |org
             Status|NEW                         |ASSIGNED
   Last reconfirmed|2007-09-11 09:54:54         |2007-09-11 09:55:11
               date|                            |


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
  2007-09-11  9:55 ` [Bug fortran/33387] " fxcoudert at gcc dot gnu dot org
  2007-09-11  9:55 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-11 13:03 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 23:35 ` fxcoudert at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-11 13:03 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
                   ` (2 preceding siblings ...)
  2007-09-11 13:03 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-22 23:35 ` fxcoudert at gcc dot gnu dot org
  2007-09-22 23:36 ` fxcoudert at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 23:35 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from fxcoudert at gcc dot gnu dot org  2007-09-22 23:35 -------
Created an attachment (id=14245)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=14245&action=view)
First patch

First implementation. It doesn't even regtest, but I'll attach it here to avoid
loosing it. I'll get back to it for 4.4, it's too much change too late for 4.3
now.


-- 


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
                   ` (3 preceding siblings ...)
  2007-09-22 23:35 ` fxcoudert at gcc dot gnu dot org
@ 2007-09-22 23:36 ` fxcoudert at gcc dot gnu dot org
  2008-02-25 12:05 ` fxcoudert at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2007-09-22 23:36 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
                   ` (4 preceding siblings ...)
  2007-09-22 23:36 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-25 12:05 ` fxcoudert at gcc dot gnu dot org
  2008-02-27 14:33 ` fxcoudert at gcc dot gnu dot org
  2008-02-27 14:34 ` fxcoudert at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-25 12:05 UTC (permalink / raw)
  To: gcc-bugs



-- 

fxcoudert at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |http://gcc.gnu.org/ml/gcc-
                   |                            |patches/2008-
                   |                            |02/msg01147.html
           Keywords|                            |patch
   Target Milestone|---                         |4.4.0


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
                   ` (5 preceding siblings ...)
  2008-02-25 12:05 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-27 14:33 ` fxcoudert at gcc dot gnu dot org
  2008-02-27 14:34 ` fxcoudert at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-27 14:33 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from fxcoudert at gcc dot gnu dot org  2008-02-27 14:32 -------
Subject: Bug 33387

Author: fxcoudert
Date: Wed Feb 27 14:32:02 2008
New Revision: 132713

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=132713
Log:
        PR fortran/33387

        * trans.h: Remove prototypes for gfor_fndecl_math_exponent4,
        gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and
        gfor_fndecl_math_exponent16.
        * f95-lang.c (build_builtin_fntypes): Add new function types.
        (gfc_init_builtin_functions): Add new builtins for nextafter,
        frexp, ldexp, fabs, scalbn and inf.
        * iresolve.c (gfc_resolve_rrspacing): Don't add hidden arguments.
        (gfc_resolve_scale): Don't convert type of second argument.
        (gfc_resolve_set_exponent): Likewise.
        (gfc_resolve_size): Don't add hidden arguments.
        * trans-decl.c: Remove gfor_fndecl_math_exponent4,
        gfor_fndecl_math_exponent8, gfor_fndecl_math_exponent10 and
        gfor_fndecl_math_exponent16.
        * trans-intrinsic.c (gfc_intrinsic_map): Remove intrinsics
        for scalbn, fraction, nearest, rrspacing, set_exponent and
        spacing.
        (gfc_conv_intrinsic_exponent): Directly call frexp.
        (gfc_conv_intrinsic_fraction, gfc_conv_intrinsic_nearest,
        gfc_conv_intrinsic_spacing, gfc_conv_intrinsic_rrspacing,
        gfc_conv_intrinsic_scale, gfc_conv_intrinsic_set_exponent): New
        functions.
        (gfc_conv_intrinsic_function): Use the new functions above.

Modified:
    trunk/gcc/fortran/ChangeLog
    trunk/gcc/fortran/f95-lang.c
    trunk/gcc/fortran/iresolve.c
    trunk/gcc/fortran/trans-decl.c
    trunk/gcc/fortran/trans-intrinsic.c
    trunk/gcc/fortran/trans.h


-- 


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


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

* [Bug fortran/33387] Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions
  2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
                   ` (6 preceding siblings ...)
  2008-02-27 14:33 ` fxcoudert at gcc dot gnu dot org
@ 2008-02-27 14:34 ` fxcoudert at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: fxcoudert at gcc dot gnu dot org @ 2008-02-27 14:34 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from fxcoudert at gcc dot gnu dot org  2008-02-27 14:33 -------
Fixed on mainline.


-- 

fxcoudert at gcc dot gnu dot org changed:

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


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


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

end of thread, other threads:[~2008-02-27 14:34 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-11  9:54 [Bug fortran/33387] New: Fortran front-end should translate intrinsics by calling C99 function instead of libgfortran functions fxcoudert at gcc dot gnu dot org
2007-09-11  9:55 ` [Bug fortran/33387] " fxcoudert at gcc dot gnu dot org
2007-09-11  9:55 ` fxcoudert at gcc dot gnu dot org
2007-09-11 13:03 ` fxcoudert at gcc dot gnu dot org
2007-09-22 23:35 ` fxcoudert at gcc dot gnu dot org
2007-09-22 23:36 ` fxcoudert at gcc dot gnu dot org
2008-02-25 12:05 ` fxcoudert at gcc dot gnu dot org
2008-02-27 14:33 ` fxcoudert at gcc dot gnu dot org
2008-02-27 14:34 ` fxcoudert 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).