From: | Peter Flass <Peter_Flass@Yahoo.com> |
Newsgroups: | comp.compilers,comp.lang.pl1 |
Date: | Fri, 17 Aug 2007 18:02:08 -0400 |
Organization: | Road Runner High Speed Online http://www.rr.com |
References: | 07-08-01607-08-021 07-08-024 07-08-034 07-08-037 07-08-040 07-08-041 07-08-044 |
Keywords: | PL/I |
Posted-Date: | 18 Aug 2007 09:32:28 EDT |
Brooks Moses wrote:
> My suggestion (from a language-design standpoint; I don't know if
> you're writing from that direction or as a PL/I implementor, since
> this is crossposted) would be to do neither. The point of such a
> construction is to allow the compiler to make the fastest possible
> code. If the language _guarantees_ either serial or parallel
> semantics, there will necessarily be cases where the compiler will
> have to pessimize the code due to things that it cannot prove are
> independent.
>
> Furthermore, if a person _wants_ serial semantics, they can write a
> for-loop, and if they want parallel semantics for a case that requires
> a temporary, they can write their own array temporary (which means
> they won't be surprised by its existence).
>
> Thus, I would recommend that the language standard say that array
> assignments where the right-hand side depends on data which is aliased
> with the left-hand side are simply illegal code, and in those cases the
> result is undefined.
>
> (It may be useful to relax this, and allow the right-hand side for a
> given element to depend on data that is aliased with its own left-hand
> side element, but not with other elements in the left-hand side.) ...
Thanks for the reply. I guess I'll have to dig out the standard and
see how it actually reads. Given the choice, however, I'm going for
compatibility with the IBM compilers, even for things that are
"undefined" since there's always someone who has written code that
depends on a specific behavior.
[I dug out my copy of the 1976 PL/I standard, and I can't figure out
whether it has parallel or serial semantics, although sec 1.2.1.4 (3)
does say that an expression may be evaluated in any order. So perhaps
it has neither. -John]
Return to the
comp.compilers page.
Search the
comp.compilers archives again.