Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!aplcen!aplcomm!uunet!weyrich!orville From: orville@weyrich.UUCP (Orville R. Weyrich) Newsgroups: comp.lang.fortran Subject: Re: Order of variables in EQUIVALENCE statement Message-ID: <1991Jun19.092500.2008@weyrich.UUCP> Date: 19 Jun 91 09:25:00 GMT References: <99850@lll-winken.LLNL.GOV> <1991Jun18.195315.18248@wdl1.wdl.loral.com> Reply-To: orville@weyrich.UUCP (Orville R. Weyrich) Distribution: na Organization: Weyrich Computer Consulting Lines: 27 In article <1991Jun18.195315.18248@wdl1.wdl.loral.com> ekman@wdl30.wdl.loral.com (Donald Ekman) writes: >In article <99850@lll-winken.LLNL.GOV> lindner@ncis.llnl.gov (Curt Lindner) writes: >>I've been in the the process of converting some code using 'f77cvt' on >>a SUN Sparcstation. >> >>The conversion is swapping the variables in the equivalence statements, >>which it shouldn't do, as far as I can tell. >> >>Does this have an adverse affect on the results of the code, i.e. does the >>first variable take on the value of the second, or vice versa?? >> >Since the equivalence statement simply causes each of the variable names to >reference the same storage location, the order is irrelevant, I believe. I would agree with you from the point of view of program correctness. However ... I don't know about Sparcstations, but word-boundary alignment problems used to haunt old IBM mainframes, and so the order could affect run-time efficiency if the equivalenced variables were of different data types. -------------------------------------- ****************************** Orville R. Weyrich, Jr., Ph.D. Certified Systems Professional Internet: orville%weyrich@uunet.uu.net Weyrich Computer Consulting Voice: (602) 391-0821 POB 5782, Scottsdale, AZ 85261 Fax: (602) 391-0023 (Yes! I'm available) -------------------------------------- ******************************