This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c/36359] [Regression] compile error in linux-kernel 2.6.26-rc4 with -O2
- From: "mt-ml at gmx dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Jun 2008 00:17:34 -0000
- Subject: [Bug c/36359] [Regression] compile error in linux-kernel 2.6.26-rc4 with -O2
- References: <bug-36359-16254@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #8 from mt-ml at gmx dot de 2008-06-08 00:17 -------
I've been able to identify the code where ilog2 is called. If I do not choose
usbcore as a module I get the following error:
drivers/built-in.o: In function `usb_submit_urb':
(.text+0xc247f): undefined reference to `____ilog2_NaN'
make: *** [.tmp_vmlinux1] Fehler 1
Observing that function usb_submit_urb() in drivers/usb/core/urb.c shows the
interesting lines should be:
case USB_ENDPOINT_XFER_INT:
/* too small? */
if (urb->interval <= 0)
return -EINVAL;
/* too big? */
switch (dev->speed) {
case USB_SPEED_HIGH: /* units are microframes */
/* NOTE usb handles 2^15 */
if (urb->interval > (1024 * 8))
urb->interval = 1024 * 8;
max = 1024 * 8;
break;
case USB_SPEED_FULL: /* units are frames/msec */
case USB_SPEED_LOW:
if (xfertype == USB_ENDPOINT_XFER_INT) {
if (urb->interval > 255)
return -EINVAL;
/* NOTE ohci only handles up to 32 */
max = 128;
} else {
if (urb->interval > 1024)
urb->interval = 1024;
/* NOTE usb and ohci handle up to 2^15 */
max = 1024;
}
break;
default:
return -EINVAL;
}
/* Round down to a power of 2, no more than max */
urb->interval = min(max, 1 << ilog2(urb->interval));
}
As you can see, the argument to ilog2 is urb->interval which can't be zero at
that point IMHO.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36359