From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fee84,d055dd2f0172279a X-Google-Attributes: gidfee84,public X-Google-ArrivalTime: 1995-02-14 09:15:58 PST Newsgroups: comp.unix.osf.osf1 Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!udel!gatech!swrinde!news.uh.edu!uuneo.neosoft.com!nmtigw!peter From: peter@nmti.com (Peter da Silva) Subject: Re: Alpha compiler bug Message-ID: Sender: peter@nmti.com (peter da silva) Organization: Network/development platform support, NMTI References: <3houb5$8cr@vixen.cso.uiuc.edu> Date: Tue, 14 Feb 1995 17:15:58 GMT In article <3houb5$8cr@vixen.cso.uiuc.edu>, Steve Peltz wrote: > Expression such as: > (temp = a + b, temp * (a + b)) + (temp = c + d, temp * (c + d)) > do not compile correctly with optimization level greater than 0. It uses > the same value of temp for both multiplies, instead of correctly handling > the parenthesized comma separated expressions. This is actually undefined behaviour for ANSI. All the comma operators guarantee is that "temp = a + b" will be evaluated before "temp * (a + b)", and similarly for the second expression. It is legal for the compiler to evaluate this as: temp = a + b; temp = c + d; ... temp * (a + b) + temp * (c + d); -- Peter da Silva `-_-' Network Management Technology Incorporated 'U` 1601 Industrial Blvd. Sugar Land, TX 77478 USA +1 713 274 5180 "Hast du Heute schon deinen Wolf umarmt?"