public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug fortran/32600]  New: [ISO Bind C] C_LOC/C_FUNLOC should not be library functions
@ 2007-07-02 22:54 burnus at gcc dot gnu dot org
  2007-07-02 23:10 ` [Bug fortran/32600] " burnus at gcc dot gnu dot org
                   ` (16 more replies)
  0 siblings, 17 replies; 18+ messages in thread
From: burnus at gcc dot gnu dot org @ 2007-07-02 22:54 UTC (permalink / raw)
  To: gcc-bugs

The code

use iso_c_binding
integer, target :: i
type(c_ptr) :: bar
bar = c_loc(i)
end

produces:

  bar = c_loc (&i);

g95 produces:
  bar = &i;;
and NAG f95:
  bar_ = (char*) &i_;

Analogously for C_FUNPOINTER:
---------------
use iso_c_binding
interface
  subroutine bar() bind(c)
  end subroutine bar
end interface
type(c_funptr) :: fptr
fptr = c_funloc(bar)
end
---------------

gfortran:
  void * fptr;
  fptr = c_funloc (bar);
g95:
  void (*<T34>) (void) fptr;
  fptr = bar;;
NAG f95:
  typedef void * __NAGf90_MODULE_iso_c_binding_DT_c_ptr;
  typedef void (* __NAGf90_MODULE_iso_c_binding_DT_c_funptr)();
  auto __NAGf90_MODULE_iso_c_binding_DT_c_funptr fptr_;
  fptr_ = (void(*)())bar;


-- 
           Summary: [ISO Bind C] C_LOC/C_FUNLOC should not be library
                    functions
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Keywords: missed-optimization
          Severity: normal
          Priority: P3
         Component: fortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: burnus at gcc dot gnu dot org


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


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

end of thread, other threads:[~2008-05-25 17:56 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-02 22:54 [Bug fortran/32600] New: [ISO Bind C] C_LOC/C_FUNLOC should not be library functions burnus at gcc dot gnu dot org
2007-07-02 23:10 ` [Bug fortran/32600] " burnus at gcc dot gnu dot org
2007-07-03  3:55 ` kargl at gcc dot gnu dot org
2007-07-03  5:27 ` burnus at gcc dot gnu dot org
2007-07-03 10:19 ` fxcoudert at gcc dot gnu dot org
2007-07-18 23:30 ` patchapp at dberlin dot org
2007-07-19  6:14 ` burnus at gcc dot gnu dot org
2007-07-21  8:04 ` pinskia at gcc dot gnu dot org
2007-07-21  8:05 ` pinskia at gcc dot gnu dot org
2007-07-21 20:18 ` burnus at gcc dot gnu dot org
2007-07-22  6:10 ` patchapp at dberlin dot org
2007-07-23  6:03 ` burnus at gcc dot gnu dot org
2007-10-15  1:07 ` [Bug fortran/32600] [ISO Bind C] C_ASSOCIATED/C_F_POINTER w/o SHAPE " patchapp at dberlin dot org
2007-10-15 19:59 ` burnus at gcc dot gnu dot org
2007-10-15 20:00 ` [Bug fortran/32600] [ISO Bind C] C_F_POINTER w/o SHAPE should not be a library function burnus at gcc dot gnu dot org
2008-03-13 14:37 ` fxcoudert at gcc dot gnu dot org
2008-05-25 17:53 ` burnus at gcc dot gnu dot org
2008-05-25 17:56 ` burnus 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).