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: lionel@quark.enet.dec.com (Steve Lionel) Subject: Re: Fortran 90 merge statement Date: 1995/06/01 Message-ID: <3qkn3d$sjc@jac.zko.dec.com>#1/1 X-Deja-AN: 103619024 distribution: world references: <3qhucj$kgg@gaia.ucs.orst.edu> organization: Digital Equipment Corporation, Nashua NH reply-to: lionel@quark.enet.dec.com (Steve Lionel) newsgroups: comp.lang.fortran,comp.sys.dec In article <3qhucj$kgg@gaia.ucs.orst.edu>, rodney@oce.orst.edu (Rodney James) writes: |>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? As Mike Metcalf says, the standard does not say that the expression is not evaluated if the mask value is false - the minimal text in the standard implies to me that it is only the "store" into the function value which is affected by the mask value. I have a suspicion that the other compilers are also evaluating the expression for all values - the difference on the Alpha system is that our default for exceptions is to report them rather than store an IEEE exceptional value. Some other systems store the IEEE exceptional value (NaN, Infinity). You can get the IEEE exceptional values if you want by compiling with the -fpe1 switch. I tried this and the program ran to completion. Our philosophu is that most users prefer a default which provides the best performance and which highlights potential program bugs. If IEEE exceptional values are wanted, the programmer can easily select that behavior. -- Steve Lionel Mail: lionel@quark.enet.dec.com DEC Fortran Development WWW: http://www.digital.com/info/slionel.html Digital Equipment Corporation CompuServe: 75263,3001 110 Spit Brook Road, ZKO2-3/N30 Nashua, NH 03062-2698 "Free advice is worth every cent" For a summary of Digital's Internet services, send mail to info@digital.com