🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.lang.modula2
Article #2111

Re: Oberon vs Modula-2

#2111
From: Cheryl Lins
Date: Mon, 16 Nov 1992 22:18
68 lines
3168 bytes
In article <gpjqq!h+@aix01.rz.fht-mannheim.de> mw%ki.fht-mannheim.de (Marc Wachowitz) writes:

>Andreas Borchert (borchert@titania.mathematik.uni-ulm.de) wrote
>in reply to Markku Sakkinen <sakkinen@jyu.fi>:
>: Agreed, programmers shouldn't be enforced to use VAR-parameters
>: for reasons of efficiency only. But, even with the semantics of
>: Oberon or Modula-2, it's not to difficult for the compiler to
>: detect that your 1000 x 1000 array isn't modified and, thus,
>: doesn't need to be copied.
>
>That doesn't work as soon as your procedure is public and (directly or
>indirectly) calls some procedure not fully known to the compiler, since
>the original argument may be accessible and modified behind the back of the
>supposedly innocent routine. According to the current definition it only
>sees a copy made at the entry and therefore would not be influenced by the
>perfectly legal modification, but due to our smart optimizer ... :-(
>

Actually interprocedural side-effect analysis  and alias analysis are fairly
complex. See the references below. Very few production compilers implement
such analyses.

If the actual parameter is a globally exported variable, and the routine (call
it "p") calls through a procedure variable, it may be impossible at compile-
time to determine whether the actual parameter is modified or not.

While the symbol file could be enhanced to carry the interprocedural alias and
side-effect information (and this could improve the analysis in modules calling
imported procedures), there will still be situations where the compiler cannot
determine the full effects. Additional analysis could be done at link-time,
but a good deal of additional information would be necessary for a linker to
do this. Probably not impossible, just a lot of work.


@inproceedings{cooper:88b,
	author		= "Keith D. Cooper and Ken Kennedy",
	title		= "Interprocedural side-effect analysis in linear time",
	booktitle	= pldi88,
	journal		= sigplan,
	volume		= 23,
	number		= 7,
	pages		= "57--66",
	address		= "Atlanta, GA",
	month		= jun,
	year		= 1988}


@techreport{cooper:88c,
	author		= "Keith D. Cooper and Ken Kennedy",
	title		= "Complexity of interprocedural side-effect analysis",
	institution	= Rice,
	type		= "Technical Report",
	number		= "Rice COMP TR87-61",
	year		= 1988}

@inproceedings{cooper:89a,
	author		= "Keith D. Cooper and Ken Kennedy",
	title		= "Fast interprocedural alias analysis",
	booktitle	= popl89,
	pages		= "49--59",
	address		= "Austin, TX",
	month		= jan,
	year		= 1989}


-- 
Cheryl Lins  Oberon Paladin  lins@apple.com
"You bloated sack of protoplasm!" - Ren
Technical Details
Message-ID: <1992Nov16.221811.8761@gallant.apple.com>
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!agate!apple!mumbo.apple.com!gallant.apple.com!cheryl
References: <1992Nov16.080647.26783@informatik.uni-ulm.de> <gpjqq!h+@aix01.rz.fht-mannheim.de>

Show Full Headers
Complete Article Headers
Newsgroups: comp.lang.modula2
Path: arc1-ca.pugleaf.net!sparky!uunet!charon.amdahl.com!pacbell.com!sgiblab!spool.mu.edu!agate!apple!mumbo.apple.com!gallant.apple.com!cheryl
From: cheryl@gallant.apple.com (Cheryl Lins)
Subject: Re: Oberon vs Modula-2
Message-ID: <1992Nov16.221811.8761@gallant.apple.com>
Date: Mon, 16 Nov 1992 22:18:11 GMT
References: <1992Nov16.080647.26783@informatik.uni-ulm.de> <gpjqq!h+@aix01.rz.fht-mannheim.de>
Organization: Apple Computer Inc, Cupertino, CA
Lines: 68