Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Posting-Version: version B 2.10.1 (Tek) 9/26/83; site hercules.UUCP Path: utzoo!watmath!clyde!bonnie!akgua!sdcsvax!sdcrdcf!hplabs!tektronix!teklds!hercules!archiel From: archiel@hercules.UUCP (Archie Lachner) Newsgroups: net.bugs.4bsd,net.lang.c Subject: bug in cc optimizer Message-ID: <291@hercules.UUCP> Date: Thu, 27-Sep-84 13:43:40 EDT Article-I.D.: hercules.291 Posted: Thu Sep 27 13:43:40 1984 Date-Received: Sun, 30-Sep-84 04:36:55 EDT Organization: Tektronix, Beaverton OR Lines: 19 Xref: 1091 2556 There in a bug in the way the 4.2bsd C compiler treats bit fields under some circumstances when optimization is turned on. If there is a bit field 16 bits long that falls on a byte boundary, the optimizer issues a "cvtwl," "movwl," or "movzwl" instruction instead of an "extv" or "extzv" instruction when extracting the field, since the former are more efficient than the latter. However, the address used for the field in any of the former is incorrect. I have short program that documents this bug, if anyone is interested. I don't know if this bug is present on other versions of UNIX, since I only have 4.2 available to me. -- Archie Lachner Logic Design Systems Division Tektronix, Inc. uucp: {ucbvax,decvax,pur-ee,cbosg,ihnss}!tektronix!teklds!archiel CSnet: archiel@tek ARPAnet: archiel.tek@csnet-relay