🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.misc
Article #1148

Re: JLG's flogging of horses (was Re: Relationship between C and C++)

#1148
From: Jim Giles
Date: Tue, 10 Apr 1990 07:27
22 lines
1510 bytes
From article <20026@megaron.cs.arizona.edu>, by gudeman@cs.arizona.edu (David Gudeman):
> [...]
> This is another statement that is wrong.  Compilers can optimize
> pointer arithmetic to the same extent as array indexing.

You can see why this issue never goes away.  People keep asserting the
above as if it were true.  Arrays can be optimized as well as pointers
can, but the reverse is not true without expensive (and rare) global
data flow analysis on the interprocedural level.

> [...]                                                         It is
> true that the optimization of pointer arithmetic is more difficult,
> but a good enough compiler can detect all possible aliases by global
> control flow analysis, even with seperate compilation.

That's just the point.  The _compiler_ can't do any such thing!  That's
the _definition_ separate compilation - the different program units
are unknown to each other at compile time.  The only implementation
so far proposed (on the net anyway) which does interprocedual data
flow analysis in this way has the _loader_ do code generation.

J. Giles
Technical Details
Message-ID: <14319@lambda.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!lanl!lambda!jlg
References: <20026@megaron.cs.arizona.edu>

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!lanl!lambda!jlg
From: jlg@lambda.UUCP (Jim Giles)
Newsgroups: comp.lang.misc
Subject: Re: JLG's flogging of horses (was Re: Relationship between C and C++)
Message-ID: <14319@lambda.UUCP>
Date: 10 Apr 90 07:27:26 GMT
References: <20026@megaron.cs.arizona.edu>
Lines: 22