This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/42439] New: Linux kernel BUILD_BUG_ON() broke
- From: "andi-gcc at firstfloor dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 20 Dec 2009 00:53:36 -0000
- Subject: [Bug c/42439] New: Linux kernel BUILD_BUG_ON() broke
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
The linux kernel uses a special macro BUILD_BUG_ON() that uses
some tricks using bitfields to evaluate constant expressions at compile time
and error out if they are violated.
One of the BUILD_BUG_ON()s in a recent kernel now fail with gcc 4.5 snapshot
(gcc version 4.5.0 20091219 (experimental) (GCC)),
when 4.4 and earlier work.
The actual expression is evaluated correctly (I replaced it with a different
form and that worked)
I'll be submitting a workaround to the kernel, but it might be some
sort of regression.
I'm attaching the preprocessed file
% gcc44 fs/compat_ioctl.i -O2 -c (as expected)
% gcc45 fs/compat_ioctl.i -O2 -c
linux-2.6.33-rc1-ak/fs/compat_ioctl.c: In function 'compat_ioctl_check_table':
linux-2.6.33-rc1-ak/fs/compat_ioctl.c:1653:24: error: bit-field '<anonymous>'
width not an integer constant
(fails)
--
Summary: Linux kernel BUILD_BUG_ON() broke
Product: gcc
Version: 4.5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: andi-gcc at firstfloor dot org
GCC build triplet: x86_64-linux
GCC host triplet: x86_64-linux
GCC target triplet: x86_64-linux
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42439