Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!rutgers!sun-barr!apple!ames!vsi1!altos86!elxsi!beatnix!corbett From: corbett@beatnix.UUCP (Bob Corbett) Newsgroups: comp.lang.fortran Subject: Fortran 8x: pointers and optimization Message-ID: <2773@elxsi.UUCP> Date: 26 Jun 89 22:31:02 GMT Sender: news@elxsi.UUCP Reply-To: uunet!elxsi!corbett (Bob Corbett) Distribution: usa Organization: ELXSI, San Jose Lines: 44 There have been articles posted to this group claiming that pointers make optimization impossible and that the SET RANGE and IDENTIFY statements would not affect optimization. Those claims are simply wrong. Adding pointers will make optimization more difficult. Adding functionality to a language almost always makes optimization more difficult. Adding pointers will make alias detection more difficult. However, there are good and well-publicized algorithms for performing alias detection in the presence of pointers. See, for example, pages 647-653 of the book Compilers: Principles, Techniques, and Tools by Aho, Sethi, and Ullman. Optimization of codes that do not use pointers should be unaffected beyond the need to detect that pointers are not used. Many languages that provide pointers do not allow pointers to reference named variables. Such a restriction makes alias detection easier. I would be willing to accept that restriction in Fortran 8x. The claim that the SET RANGE and IDENTIFY statements do not affect optimization is bizarre. I cannot understand how anyone could think that the IDENTIFY statement does not create an alias when the element named in the IDENTIFY statement is required to have the ALIAS attribute. The aliasing problem created by the SET RANGE statement is subtler. The SET RANGE statement makes it more difficult to tell when references to array elements overlap. I suspect that some of those who think SET RANGE and IDENTIFY are more benign than pointers missed the fact that SET RANGE and IDENTIFY are executable statements, not declarations. For example, the code fragment IF (P) THEN IDENTIFY (X = A) ELSE IDENTIFY (X = B) END IF X = Z was allowed. Thus, adding pointers does not make optimization harder than the IDENTIFY statement would. However, pointers offer more functionality than the IDENTITY statement. Yours very truly, Bob Corbett