This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: system_


Joe Griffin wrote:

> I am not sure if this is a bug or not.  The
> following program crashes with g77:
> 
> <20> cat aa.f
>        parameter (n=50)
>        common /system/ i(n)
>        do 10 j=1, n
>           i(j) = j
>    10  continue
>        end
> 
> <21> g77 -fno-globals aa.f
> /usr/bin/ld: Warning: size of symbol `system_' changed from 200 to 26 in
> Lsystem.o
> /usr/bin/ld: Warning: type of symbol `system_' changed from 1 to 2 in
> Lsystem.o

> <22> a.out
> Segmentation fault

> common/system/ gets defined at compile time as "system_":
> 
> <24> nm aa.o
> 00000000 T MAIN__
> 00000000 t gcc2_compiled.
>          U s_stop
> 000000c8 C system_

Bweh !  I'm glad I didn't think this up.

You can get *this example* to compile as follows:

g77 -fno-underscoring griffin.f

However, this only works because the example code has no external
symbols (other than the COMMON block).

Hope this helps,

[ I'll see what I can do (i.e. make this a test case in our 3.1 version)
-
  however, I do not know of a solution yet ]

-- 
Toon Moene - mailto:toon@moene.indiv.nluug.nl - phoneto: +31 346 214290
Saturnushof 14, 3738 XG  Maartensdijk, The Netherlands
Maintainer, GNU Fortran 77: http://gcc.gnu.org/onlinedocs/g77_news.html
Join GNU Fortran 95: http://g95.sourceforge.net/ (under construction)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]