public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* Problem with GCC 4.2 and above
@ 2008-03-22  2:42 Lorenzo Pesce
  0 siblings, 0 replies; only message in thread
From: Lorenzo Pesce @ 2008-03-22  2:42 UTC (permalink / raw)
  To: gcc-help

Dear all,
I have a strange problem with gcc-4.2 and above on Linux (I
compile the same code on OS X 10.4 with gcc-4.3 and it does
not create e any problems.


 I I use a simple code like this one, in the file camel.f90:

 ---------------------------------
 subroutine camel

 write(8,"(I2, ' camel')") 1

 end subroutine camel
 ----------------------------------

 and I build it as a dynamically linked library with the
 command (as is usually done, as far as I know):

 gcc -shared -fPIC -o libcamel.so cammel.f90

 I obtain the library libcamel.so.
 If I load the library in "R" [>dyn.load("libcamel.so")]and
try to call it as .C("camel_" it will crash  in misery. As far
as I know note that gcc makes functions as if they were c
functions, but I can call it as .Fortran("camel"), it will
crash just the same.

 However, if I change the function to (that is I do not use
 formatted output in fortran 90).

---------------------------------
 subroutine camel

  write(8, *) ' cammello', 1

 end subroutine camel
 ----------------------------------

 All works fine...

What am I doing wrong?

The same code compiles fine with gcc-4.1.1 on all systems
(sort of and so far). 4.2 breaks down on every non-OSX system
I have tried and in exactly the same way. It doesn't seem to
matter exactly which version they all break from 4.2 to 4.4.
Also the optimization seems to be dysfunctional (on some
architectures, like the AMD 64).

Thanks!

Lorenzo

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-03-22  2:42 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-22  2:42 Problem with GCC 4.2 and above Lorenzo Pesce

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