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 11:45:49 PST Path: nntp.gmd.de!newsserver.jvnc.net!nntpserver.pppl.gov!princeton!gw1.att.com!fnnews.fnal.gov!uwm.edu!news.alpha.net!news.mathworks.com!europa.eng.gtefsd.com!howland.reston.ans.net!math.ohio-state.edu!caen!crl.dec.com!crl.dec.com!lead.zk3.dec.com!ddhill From: ddhill@mytoy.zk3.dec.com (Dave Hill) Newsgroups: comp.unix.osf.osf1 Subject: Re: Alpha compiler bug Date: 14 Feb 1995 19:45:49 GMT Organization: Digital Equipment Corporation Message-ID: <3hr19d$atu@lead.zk3.dec.com> References: <3houb5$8cr@vixen.cso.uiuc.edu> NNTP-Posting-Host: mytoy.zk3.dec.com To: peltz@cerl.uiuc.edu (Steve Peltz) In article <3houb5$8cr@vixen.cso.uiuc.edu>, peltz@cerl.uiuc.edu (Steve Peltz) writes: |> DEC OSF/1 V3.0 (Rev. 347) |> |> 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. |> |> E.g. a=1, b=2, c=3, d=4, the correct answer is 58; the incorrect answer |> given with -O1 is 70. |> |> Am I confused and this is actually undefined behavior for ANSI, or is this |> a compiler bug? Is there a patch? |> -- |> Steve Peltz |> tricorn@uiuc.edu The same behavior is seen with v3.2 so I doubt there is a patch yet. You may wish to use the -migrate option which invokes the decc compiler. This compiler produces the value that you expected. (You may have to install the optional subset that contains decc. OSFDECC300 ??? You should also report this to Digital Customer Support. /Dave