Path: utzoo!mnetor!uunet!wucs1!wuphys!hpuslma!hpfcse!hpfcmp!hpfcdc!hpfclq!cunniff From: cunniff@hpfclq.HP.COM (Ross Cunniff) Newsgroups: comp.sys.hp Subject: Re: C compiler / Assembler bugs on HP 9000/300 Message-ID: <4260007@hpfclq.HP.COM> Date: 5 Apr 88 23:09:29 GMT References: <23519@ucbvax.BERKELEY.EDU> Organization: Hewlett-Packard Lines: 47 In article <23519@ucbvax.BERKELEY.EDU>, gregc@miro.Berkeley.EDU (Greg Couch) writes: > Below is a short program that demonstrates bugs that were found when > porting a program to the HP. I'm running HP-UX 6.0.1 and the same > bugs occured under HP-UX 5.5. The S300 people responsible for the C compiler have been notified. This bug will be fixed in some future release of HP-UX. As a workaround, use a temporary integer variable in the code, thus: main() { int t1, t2; char *a, *b, *c; float f, g; # ifdef compbug /* this DOESN'T generate a compiler error */ t1 = a - b; t2 = a - c; if ((float) t1 * 10.0 < (float) t2) ; # else /* assembug */ /* this DOESN'T generate an assembler error */ t1 = a - b; t2 = a - c; if ((float) t1 * 10.0 < (float) (f = t2)) ; # endif } N.B.: There is no bug in the assembler; in the second example given, the compiler incorrectly generated the instruction fmov.l %a0,%fp0 which is an illegal instruction. > Is there an e-mail place we can send > bugs to, like Berkeley's 4bsd-bugs@Berkeley.EDU? Not really. Contact your service representative or sales rep. to report bugs. Sigh. We could really use an e-mail address for bugs... > - Greg Couch > gregc@miro.Berkeley.EDU > gregc@Berkeley.EDU Ross Cunniff Hewlett-Packard ISD/UDL ...{ucbvax,hplabs}!hpda!cunniff cunniff%hpda@hplabs.ARPA