From owner-freebsd-current@FreeBSD.ORG Mon May 28 07:57:24 2007 Return-Path: X-Original-To: current@freebsd.org Delivered-To: freebsd-current@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id E8BFE16A421 for ; Mon, 28 May 2007 07:57:24 +0000 (UTC) (envelope-from hselasky@c2i.net) Received: from swip.net (mailfe03.swip.net [212.247.154.65]) by mx1.freebsd.org (Postfix) with ESMTP id 5693813C457 for ; Mon, 28 May 2007 07:57:24 +0000 (UTC) (envelope-from hselasky@c2i.net) X-Cloudmark-Score: 0.000000 [] Received: from [88.88.46.79] (account mc467741@c2i.net HELO [192.168.0.102]) by mailfe03.swip.net (CommuniGate Pro SMTP 5.1.7) with ESMTPA id 510536535; Mon, 28 May 2007 08:57:22 +0200 From: Hans Petter Selasky To: freebsd-current@freebsd.org Date: Mon, 28 May 2007 08:57:11 +0200 User-Agent: KMail/1.9.5 References: <009501c79fdf$19e25880$1e00000a@hhp.local> <78664C02FF341B4FAC63E561846E3BCC0A1103@ex.hhp.local> In-Reply-To: <78664C02FF341B4FAC63E561846E3BCC0A1103@ex.hhp.local> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200705280857.12035.hselasky@c2i.net> Cc: current@freebsd.org Subject: Re: vrp bitfield miscompilation (WAS: [Regression] snd_emu10k1 doesn't work after GCC 4.2 upgrade) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 28 May 2007 07:57:25 -0000 On Monday 28 May 2007 08:22, Yuriy Tsibizov wrote: > > -----Original Message----- > > From: Yuriy Tsibizov > > Sent: Sunday, May 27, 2007 1:42 AM > > To: Yuriy Tsibizov; kabaev@gmail.com > > Cc: current@freebsd.org > > Subject: Re: [Regression] snd_emu10k1 doesn't work after GCC > > 4.2 upgrade > > > > See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32100 > > Use of following variables _can_ be affected by above miscompilation > (these are signed single-bit variables): > > amd64/amd64/mp_machdep.c: int cpu_present:1; > amd64/amd64/mp_machdep.c: int cpu_bsp:1; > amd64/amd64/mp_machdep.c: int cpu_disabled:1; > dev/acpica/acpi_pci_link.c: int l_routed:1; > dev/acpica/acpi_pci_link.c: int l_isa_irq:1; > dev/sound/isa/ess.c: int type, duplex:1, newspeed:1; > dev/sound/pci/emu10k1.c: int b16:1, stereo:1, busy:1, running:1, > ismaster:1; > dev/sound/pci/solo.c: int simplex_dir, type, duplex:1, > newspeed:1, dmasz[2]; > dev/puc/puc.c: int p_hasintr:1; > dev/puc/puc_bfe.h: int sc_fastintr:1; > dev/puc/puc_bfe.h: int sc_leaving:1; > dev/puc/puc_bfe.h: int sc_polled:1; > dev/rp/rpvar.h: int rp_rts_iflow:1; > dev/rp/rpvar.h: int rp_disable_writes:1; > dev/rp/rpvar.h: int rp_cts:1; > dev/rp/rpvar.h: int rp_waiting:1; > dev/rp/rpvar.h: int rp_xmit_stopped:1; > dev/scc/scc_bfe.h: int m_attached:1; > dev/scc/scc_bfe.h: int m_fastintr:1; > dev/scc/scc_bfe.h: int m_hasintr:1; > dev/scc/scc_bfe.h: int m_probed:1; > dev/scc/scc_bfe.h: int m_sysdev:1; > dev/scc/scc_bfe.h: int ch_enabled:1; > dev/scc/scc_bfe.h: int ch_sysdev:1; > dev/scc/scc_bfe.h: int sc_fastintr:1; > dev/scc/scc_bfe.h: int sc_leaving:1; > dev/scc/scc_bfe.h: int sc_polled:1; > dev/uart/uart_bus.h: int sc_callout:1; /* This UART is > opened for callout. */ > dev/uart/uart_bus.h: int sc_fastintr:1; /* This UART > uses fast interrupts. */ > dev/uart/uart_bus.h: int sc_hwiflow:1; /* This UART has > HW input flow ctl. */ > dev/uart/uart_bus.h: int sc_hwoflow:1; /* This UART has > HW output flow ctl. */ > dev/uart/uart_bus.h: int sc_leaving:1; /* This UART is > going away. */ > dev/uart/uart_bus.h: int sc_opened:1; /* This UART is > open for business. */ > dev/uart/uart_bus.h: int sc_polled:1; /* This UART has > no interrupts. */ > dev/uart/uart_bus.h: int sc_txbusy:1; /* This UART is > transmitting. */ > fs/pseudofs/pseudofs_internal.h: int pvd_dead:1; > geom/part/g_part.h: int gpe_created:1; /* Entry is > newly created. */ > geom/part/g_part.h: int gpe_deleted:1; /* Entry has > been deleted. */ > geom/part/g_part.h: int gpe_modified:1; /* Entry has > been modified. */ > geom/part/g_part.h: int gpt_isleaf:1; /* Cannot be > sub-partitioned. */ > geom/part/g_part.h: int gpt_created:1; /* Newly > created. */ > geom/part/g_part.h: int gpt_modified:1; /* Table changes > have been made. */ > geom/part/g_part.h: int gpt_opened:1; /* Permissions > obtained. */ > i386/i386/mp_machdep.c: int cpu_present:1; > i386/i386/mp_machdep.c: int cpu_bsp:1; > i386/i386/mp_machdep.c: int cpu_disabled:1; > i386/include/npx.h: int fp_sgn:1; /* mantissa sign */ > sparc64/pci/psycho.c: int apb:1; > sparc64/pci/psycho.c: int ppb:1; > > I can't say that there _is_ a miscompilation related to all variables in > this list. > > Should most of them (I'm not shure for fp_sign) be changed to unsigned > int? With (signed) int these flags have values of (-1;0), with unsigned > int they will use more obvious (0;1) values. > > > Yuriy. Interesting find. Another issue: I've seen that the compile will round the memory size of a bit-fields down to the nearest byte, if you turn on optimization. I think you should use "uint8_t". --HPS