🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #2054

Re: Whether cc after f2c can optimize arrays as well as f77 can

#2054
From: Dan Bernstein
Date: Wed, 14 Nov 1990 05:45
32 lines
2001 bytes
In article <5837@lanl.gov> jlg@lanl.gov (Jim Giles) writes:
> From article <4610:Nov1323:35:0390@kramden.acf.nyu.edu>, by brnstnd@kramden.acf.nyu.edu (Dan Bernstein):
> >   [ as another supposed counterexample, an unreadable rendition of: ]
> Look who's talking.  You're the one that always flattens them out to
> unreadible one-liners.

This is much more readable than your huge cut-and-paste format. Remember
the importance of context: it's much easier to read things that fit on
one page. My version below takes four lines, shows the variables and
procedures clearly, and doesn't distract the reader.

> >   [ int a; main() { ... sub1(&a); } ]
> >   [        sub1(x) { ... sub2(x); sub3(x); } ]
> >   [ int a; sub2(y) { ... } ]
> >   [ int b; sub3(z) { ... } ]
> > Now a and b are GLOBAL! My solution DOES detect what aliasing goes on!
> Really?  I'm sorry.  I don't see it.

Fortran does not have separate compilation like C. It does not have
static variables like C. Hence a and b are visible throughout---though
your C version does not reflect this accurately. The partitions for
sub1() include a and b, as do the partitions for sub2() and sub3().

Since you apparently didn't understand what I was saying, here goes
again:

> > Sorry for shouting, but I'm getting really sick of your unjustified
> > attacks. If your variables have visibility as in Fortran, it *works*. If
> > you're not talking about a program that can be expressed the same way in
> > Fortran, then you're not talking about the same problem.

---Dan
Technical Details
Message-ID: <4962:Nov1405:45:5090@kramden.acf.nyu.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
References: <4610:Nov1323:35:0390@kramden.acf.nyu.edu> <5837@lanl.gov>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!yale!cmcl2!kramden.acf.nyu.edu!brnstnd
From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein)
Newsgroups: comp.lang.misc
Subject: Re: Whether cc after f2c can optimize arrays as well as f77 can
Message-ID: <4962:Nov1405:45:5090@kramden.acf.nyu.edu>
Date: 14 Nov 90 05:45:50 GMT
References: <4610:Nov1323:35:0390@kramden.acf.nyu.edu> <5837@lanl.gov>
Organization: IR
Lines: 32