Path: utzoo!attcan!telly!lethe!yunexus!ists!helios.physics.utoronto.ca!news-server.csri.toronto.edu!cs.utexas.edu!usc!elroy.jpl.nasa.gov!ncar!midway!msuinfo!rang From: rang@cs.wisc.edu (Anton Rang) Newsgroups: comp.lang.misc Subject: Re: C vs. FORTRAN aliasing Message-ID: Date: 26 Nov 90 21:44:29 GMT References: <15704.274a7509@levels.sait.edu.au> Sender: news@msuinfo.cl.msu.edu Organization: UW-Madison CS department Lines: 18 In-Reply-To: bglenden@mandrill.cv.nrao.edu's message of 21 Nov 90 19:21:52 GMT In article bglenden@mandrill.cv.nrao.edu (Brian Glendenning) writes: >Do real compilers ever complain about [aliasing]? Or do FORTRAN compilers >just assume that that users will never alias subroutine arguments? I haven't seen one which complained, but there may be some out there. Of course, detecting aliasing in general is a hard problem; it's quite possible the compiler simply assumes the user knows what he's doing, and doesn't try to detect the special cases. I'm also not sure if the FORTRAN standard allows parameters to be aliased if they aren't changed in the called subroutine; I've seen a lot of FORTRAN code which looks like CALL X(A,N,N) for instance. Since the intent seems to be to allow either pass-by-reference or pass-by-value-result, I have a hard time coming up with a scenario where this *wouldn't* work (assuming, of course, that the two formal parameters are used in a read-only way)...but it might not be legal. Anton +---------------------------+------------------+-------------+ | Anton Rang (grad student) | rang@cs.wisc.edu | UW--Madison | +---------------------------+------------------+-------------+