Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!mailrus!wasatch!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hpfcdc!hpfcmgw!bobm From: bobm@hpfcmgw.HP.COM (Bob Montgomery) Newsgroups: comp.sys.hp Subject: Re: +O2 common-subexpression bug Message-ID: <1080072@hpfcmgw.HP.COM> Date: 29 Jul 89 20:49:09 GMT References: <3091@rti.UUCP> Organization: HP Fort Collins, CO Lines: 20 > Under HP-UX 6.5, the following program gives different > answers when compiled with and without "-O" (a.k.a. "+O2"). > [Apologies if this has been mentioned before, > I do not follow this group closely. > Surely this has been discovered and fixed by now!] > Tom Truscott Tom, I emailed you a copy of a previous comp.sys.hp notes posting that contains an explanation and workarounds for this 6.5 optimizer bug. One workaround is to disable common subexpression elimination in the global optimizer with the cc option "-Wg,-d" (sends "-d" to the global optimizer phase). You can avoid modifying make files by setting the CCOPTS environment variable. The 7.0 optimizer should give you a warning to remind you that the "-Wg,-d" option is no longer necessary. Bob Montgomery HP