Article View: comp.lang.misc
Article #2246Re: C vs. FORTRAN aliasing
From: Anton Rang
Date: Mon, 26 Nov 1990 21:44
Date: Mon, 26 Nov 1990 21:44
22 lines
1906 bytes
1906 bytes
In article <BGLENDEN.90Nov21142152@mandrill.cv.nrao.edu> 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 | +---------------------------+------------------+-------------+
Technical Details
Message-ID:
<RANG.90Nov26144429@nexus.cs.wisc.edu>Path:
arc1-ca.pugleaf.net!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!rangReferences:
<RANG.90Nov18160113@nexus.cs.wisc.edu> <15704.274a7509@levels.sait.edu.au> <RANG.90Nov21115939@nexus.cs.wisc.edu> <BGLENDEN.90Nov21142152@mandrill.cv.nrao.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!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: <RANG.90Nov26144429@nexus.cs.wisc.edu> Date: 26 Nov 90 21:44:29 GMT References: <RANG.90Nov18160113@nexus.cs.wisc.edu> <15704.274a7509@levels.sait.edu.au> <RANG.90Nov21115939@nexus.cs.wisc.edu> <BGLENDEN.90Nov21142152@mandrill.cv.nrao.edu> 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