🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #1968

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

#1968
From: Greg Lindahl
Date: Thu, 08 Nov 1990 03:34
56 lines
2577 bytes
In article <5853:Nov720:22:4890@kramden.acf.nyu.edu> brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes:

>Here is a very precise description of how a C compiler can detect the
>sort of non-aliasing that a Fortranish program has.

[ description deleted ]

Your description doesn't seem to work for Fortran-style aliasing. You
can't just test the starting address of an array; you must consider
the set of all addresses in the arguments which are changed by any
actual control path through the subroutine. Your example was worked
out with 3 scalar arguments. If I were a CS type, I'd probably think
the array case was pretty nasty to solve.

example: from my reading of the standard, this is valid:

      real a(10)
      call foo(a,a(3))
      ...
      subroutine foo(x,y)
      real x(3), y(7)
      x(2) = 1.0
      y(2) = 1.0

x(3) overlaps with y(1), yet since neither x(3) nor y(1) is written by
the routine, the anti-aliasing rule holds. Determining the set of all
addresses written by a subroutine with all sorts of data-dependent
branches is not fun.

Now, hit 'n' because the interesting part of this posting is over.

More quotes from the Dan Bernstein quote collection, all of these
aimed at Jim:

>Jim, please say *something* that shows you understand the above
>description.

>Now for the seventh or eighth time, here's how it applies to the
>three-file case above:

>I am getting really, really, really sick of trying to explain this to
>you; I hope my excessively detailed and formal approach here does the
>job. I will give up if you persist in ignoring the truth.

> You are becoming a bit repetitive.

>Sir, you appear to be lying. But I've promised myself not to drag you
>over the coals for your repeated misquotes, misparaphrases, misleading,
>and apparent outright lies.

And, in a different posting, Dan said to me:

> Weird, you're right.

Dan, I expect these sorts of lines in alt.flame, but not
comp.lang.misc.
Technical Details
Message-ID: <1990Nov8.033427.10529@murdoch.acc.Virginia.EDU>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!murdoch!astsun.astro.Virginia.EDU!gl8f
References: <2779:Nov608:20:1990@kramden.acf.nyu.edu> <5085@lanl.gov> <5853:Nov720:22:4890@kramden.acf.nyu.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!rutgers!mcnc!uvaarpa!murdoch!astsun.astro.Virginia.EDU!gl8f
From: gl8f@astsun.astro.Virginia.EDU (Greg Lindahl)
Newsgroups: comp.lang.misc
Subject: Re: Whether cc after f2c can optimize arrays as well as f77 can
Message-ID: <1990Nov8.033427.10529@murdoch.acc.Virginia.EDU>
Date: 8 Nov 90 03:34:27 GMT
References: <2779:Nov608:20:1990@kramden.acf.nyu.edu> <5085@lanl.gov> <5853:Nov720:22:4890@kramden.acf.nyu.edu>
Sender: news@murdoch.acc.Virginia.EDU
Organization: Department of Astronomy, University of Virginia
Lines: 56