From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 1094ba,42aaa616313a744c X-Google-Attributes: gid1094ba,public X-Google-Thread: 1164f8,42aaa616313a744c X-Google-Attributes: gid1164f8,public From: rodney@oce.orst.edu (Rodney James) Subject: Fortran 90 merge statement Date: 1995/05/31 Message-ID: <3qhucj$kgg@gaia.ucs.orst.edu>#1/1 X-Deja-AN: 103619038 organization: Oregon State University Physical Oceanography newsgroups: comp.lang.fortran,comp.sys.dec I have a question about the Fortran 90 merge statement. Consider the following Fortran 90 program: program merge_test integer,parameter:: n=100 real,dimension(-n:n):: x,y integer:: i real:: s do i=-n,n x(i) = real(i) enddo y = merge(1.0/x,0.0,x.ne.0.0) s = sum(y) write(*,*) 'sum = ',s end It works fine on an RS/6000 and a CM5, but on a Dec Alpha, I get forrtl: error (73): floating divide by zero at merge statement. Does the standard specify how the merge is implemented? Is it legal to evaluate the true and false statements _before_ checking the conditional as the alpha compiler seems to be doing, or is the alpha compiler generating incorrect code? -- -Rodney James (rodney@oce.orst.edu)