public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* Re: Fortran Question
@ 2000-05-26  3:10 MBGA8CSH
  0 siblings, 0 replies; 10+ messages in thread
From: MBGA8CSH @ 2000-05-26  3:10 UTC (permalink / raw)
  To: gcc

Thanks very much guys

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

* Re: Fortran question
  2004-08-03  6:04 ` Lassi A.Tuura
  2004-08-03  6:24   ` H. J. Lu
  2004-08-03  6:25   ` Gabriel Dos Reis
@ 2004-08-05 14:46   ` Toon Moene
  2 siblings, 0 replies; 10+ messages in thread
From: Toon Moene @ 2004-08-05 14:46 UTC (permalink / raw)
  To: Lassi A.Tuura; +Cc: Dale Johannesen, gcc_mailing_list List

Lassi A.Tuura wrote:

 > Dale Johannesen wrote:

>> With IMA, I've discovered that one of the Fortran SPEC benchmarks (fma3d)
>> has a named common block that is different sizes in different source 
>> files, in
>> violation of both the f77 and f90 standards.  However, the fact that 
>> this program
>> normally works, presumably in a lot of different environments, when it 
>> would
>> be easy to detect the error at linktime, suggests that maybe it is 
>> used a fair
>> amount in existing code, and maybe it would be a good idea for the 
>> compiler
>> to accept it.  What do the Fortran experts think?  Thanks.
> 
> I'm not a FORTRAN programmer, but I can tell what the millions of lines 
> we have here expect :-) The linker should pick the largest size for the 
> common.

This is indeed the way it is normally treated.  g77 will complain if 
verious compilation units in one source file declare different lengths 
of named common.  I haven't checked what gfortran does.

Cheers,

-- 
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
A maintainer of GNU Fortran 95: http://gcc.gnu.org/fortran/

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

* Re: Fortran question
  2004-08-03  6:25   ` Gabriel Dos Reis
@ 2004-08-03  7:58     ` Lassi A. Tuura
  0 siblings, 0 replies; 10+ messages in thread
From: Lassi A. Tuura @ 2004-08-03  7:58 UTC (permalink / raw)
  To: Gabriel Dos Reis; +Cc: Dale Johannesen, Toon Moene, gcc_mailing_list List

> Your idea of how such things work in C++ is very misleading.  C++
> requires that those implicitly instantiated templates obey the usual
> Onde Definition Rule -- pretty much in agreement with the requirement
> on COMMON block in both f77 and f90 standards.

Oh by all means I didn't mean to draw exact parallel, hence the "sort 
of".  Only my experience is that linker/dynamic linker and C++ folks 
seem to largely live on different planets, and it's good to use a 
limited number of very simple terms to make sure the two meet and 
perhaps even understand each other :-)

I am all for a clear description of exactly what should happen with 
various C++ language features at the lowest levels.  The number of 
widely used systems that have gotten them wrong, and still get them 
wrong, is so huge I don't know whether we should laugh or cry :-)

Lassi
--
Everything should be made as simple as possible, but not simpler.
	--Albert Einstein

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

* Re: Fortran question
  2004-08-03  6:04 ` Lassi A.Tuura
  2004-08-03  6:24   ` H. J. Lu
@ 2004-08-03  6:25   ` Gabriel Dos Reis
  2004-08-03  7:58     ` Lassi A. Tuura
  2004-08-05 14:46   ` Toon Moene
  2 siblings, 1 reply; 10+ messages in thread
From: Gabriel Dos Reis @ 2004-08-03  6:25 UTC (permalink / raw)
  To: Lassi A.Tuura; +Cc: Dale Johannesen, Toon Moene, gcc_mailing_list List

Lassi A.Tuura <lassi.tuura@cern.ch> writes:

| (That latter is not very typical for F77 programs, but more usual for
| current C++ programs using legacy F77 libraries.  And no, dynamic
| linker doesn't need to pick the largest common, it should pick the
| first definition and ignore all the others, no matter which library
| they come from.  Sort of like template static data in C++.)

Your idea of how such things work in C++ is very misleading.  C++
requires that those implicitly instantiated templates obey the usual
Onde Definition Rule -- pretty much in agreement with the requirement
on COMMON block in both f77 and f90 standards.

-- Gaby

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

* Re: Fortran question
  2004-08-03  6:04 ` Lassi A.Tuura
@ 2004-08-03  6:24   ` H. J. Lu
  2004-08-03  6:25   ` Gabriel Dos Reis
  2004-08-05 14:46   ` Toon Moene
  2 siblings, 0 replies; 10+ messages in thread
From: H. J. Lu @ 2004-08-03  6:24 UTC (permalink / raw)
  To: Lassi A. Tuura; +Cc: Dale Johannesen, Toon Moene, gcc_mailing_list List

On Tue, Aug 03, 2004 at 08:04:14AM +0200, Lassi A. Tuura wrote:
> >With IMA, I've discovered that one of the Fortran SPEC benchmarks 
> >(fma3d)
> >has a named common block that is different sizes in different source 
> >files, in
> >violation of both the f77 and f90 standards.  However, the fact that 
> >this program
> >normally works, presumably in a lot of different environments, when it 
> >would
> >be easy to detect the error at linktime, suggests that maybe it is 
> >used a fair
> >amount in existing code, and maybe it would be a good idea for the 
> >compiler
> >to accept it.  What do the Fortran experts think?  Thanks.
> 
> I'm not a FORTRAN programmer, but I can tell what the millions of lines 
> we have here expect :-) The linker should pick the largest size for the 
> common.
> 

Not only that, linker should also pick the largest alignment:

http://sources.redhat.com/ml/binutils/2003-04/msg00273.html


H.J.

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

* Re: Fortran question
  2004-08-03  1:10 Fortran question Dale Johannesen
@ 2004-08-03  6:04 ` Lassi A.Tuura
  2004-08-03  6:24   ` H. J. Lu
                     ` (2 more replies)
  0 siblings, 3 replies; 10+ messages in thread
From: Lassi A.Tuura @ 2004-08-03  6:04 UTC (permalink / raw)
  To: Dale Johannesen; +Cc: Toon Moene, gcc_mailing_list List

> With IMA, I've discovered that one of the Fortran SPEC benchmarks 
> (fma3d)
> has a named common block that is different sizes in different source 
> files, in
> violation of both the f77 and f90 standards.  However, the fact that 
> this program
> normally works, presumably in a lot of different environments, when it 
> would
> be easy to detect the error at linktime, suggests that maybe it is 
> used a fair
> amount in existing code, and maybe it would be a good idea for the 
> compiler
> to accept it.  What do the Fortran experts think?  Thanks.

I'm not a FORTRAN programmer, but I can tell what the millions of lines 
we have here expect :-) The linker should pick the largest size for the 
common.

At least in our F77 code it's a widely used idiom.  Some programmers 
just declare the common to a small size, such as one, assuming it's 
declared to the right size somewhere else.  For the same reason I've 
never heard that compiler-generated array bounds checking was used for 
our code.  It's useless when all the arrays are declared to 
ridiculously small sizes, and then one object file somewhere changes 
all the bounds.  Typically that object file isn't even part of the 
libraries that use the common, but in user code.  In fact, the actual 
common might get picked only at run-time by the dynamic linker :-)  
(That latter is not very typical for F77 programs, but more usual for 
current C++ programs using legacy F77 libraries.  And no, dynamic 
linker doesn't need to pick the largest common, it should pick the 
first definition and ignore all the others, no matter which library 
they come from.  Sort of like template static data in C++.)

Lassi
--
I would therefore like to posit that computing's central
challenge 'How not to make a mess of it,' has *not* been
met.  --Edsger Dijkstra

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

* Fortran question
@ 2004-08-03  1:10 Dale Johannesen
  2004-08-03  6:04 ` Lassi A.Tuura
  0 siblings, 1 reply; 10+ messages in thread
From: Dale Johannesen @ 2004-08-03  1:10 UTC (permalink / raw)
  To: gcc_mailing_list List; +Cc: Toon Moene, Dale Johannesen

With IMA, I've discovered that one of the Fortran SPEC benchmarks 
(fma3d)
has a named common block that is different sizes in different source 
files, in
violation of both the f77 and f90 standards.  However, the fact that 
this program
normally works, presumably in a lot of different environments, when it 
would
be easy to detect the error at linktime, suggests that maybe it is used 
a fair
amount in existing code, and maybe it would be a good idea for the 
compiler
to accept it.  What do the Fortran experts think?  Thanks.

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

* Re: Fortran Question
  2000-05-25 11:42 ` Martin v. Loewis
@ 2000-05-25 12:15   ` Toon Moene
  0 siblings, 0 replies; 10+ messages in thread
From: Toon Moene @ 2000-05-25 12:15 UTC (permalink / raw)
  To: Martin v. Loewis; +Cc: mbga8csh, gcc

Martin v. Loewis wrote:
> 
> > Where is the correct mailing list to ask questions about g77, or
> > any other fortran related things for Linux?
> 
> Depends on the question. If it is a bug report, gcc-bugs would be
> correct. If you need help with using g77, gcc-help is right. If you
> want to discuss further development of g77, gcc is the one you should
> use (all @gcc.gnu.org). Please note that g77 is currently unmaintained.

Thanks, Martin, for providing this answer.  However, I wouldn't call g77
"unmaintained" - it's just that we put it in "maintenance mode", i.e.
there will be no further development, but it will be updated with the
rest of the system and bugs will be fixed.

Cheers,

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

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

* Re: Fortran Question
  2000-05-25  6:03 Fortran Question MBGA8CSH
@ 2000-05-25 11:42 ` Martin v. Loewis
  2000-05-25 12:15   ` Toon Moene
  0 siblings, 1 reply; 10+ messages in thread
From: Martin v. Loewis @ 2000-05-25 11:42 UTC (permalink / raw)
  To: mbga8csh; +Cc: gcc

> Where is the correct mailing list to ask questions about g77, or 
> any other fortran related things for Linux?

Depends on the question. If it is a bug report, gcc-bugs would be
correct. If you need help with using g77, gcc-help is right. If you
want to discuss further development of g77, gcc is the one you should
use (all @gcc.gnu.org). Please note that g77 is currently unmaintained.

Regards,
Martin

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

* Fortran Question
@ 2000-05-25  6:03 MBGA8CSH
  2000-05-25 11:42 ` Martin v. Loewis
  0 siblings, 1 reply; 10+ messages in thread
From: MBGA8CSH @ 2000-05-25  6:03 UTC (permalink / raw)
  To: gcc

Where is the correct mailing list to ask questions about g77, or 
any other fortran related things for Linux?

Thanks very much,

Chris.

Where great ones walk, I always follow shortly after...

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

end of thread, other threads:[~2004-08-05 14:44 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-26  3:10 Fortran Question MBGA8CSH
  -- strict thread matches above, loose matches on Subject: below --
2004-08-03  1:10 Fortran question Dale Johannesen
2004-08-03  6:04 ` Lassi A.Tuura
2004-08-03  6:24   ` H. J. Lu
2004-08-03  6:25   ` Gabriel Dos Reis
2004-08-03  7:58     ` Lassi A. Tuura
2004-08-05 14:46   ` Toon Moene
2000-05-25  6:03 Fortran Question MBGA8CSH
2000-05-25 11:42 ` Martin v. Loewis
2000-05-25 12:15   ` Toon Moene

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