Weird behaviour, possible compiler bug?
Alex Bennee <[email protected]> Wed, 18 Aug 2004 18:22:00 +0100
| Newsgroups | gmane.comp.gcc.cross-compiling,gmane.linux.ports.sh.devel,gmane.linux.ports.sh.general |
|---|---|
| Organization | Hackers Inc |
| Message-ID | <[email protected]> |
Hi,
Has anyone been building SH kernels with Dan's latest crosstool gcc?
[alex@cambridge linux-2.6.8.1]$ sh4-unknown-linux-gnu-gcc --version
sh4-unknown-linux-gnu-gcc (GCC) 3.3.3 20040126 (prerelease)
Specifically the routine root_nfs_parse_addr() (in net/ipv4/ipconfig.c)
would parse an invalid address. It seemed to skip out the initial loop
early. I was a tad confused and started sprinkling printk's in the
routine to see what the matter could be. Finally I had the loop like
thus:
while (octets < 4) {
printk(KERN_ALERT "top: octets=%d, cp=%p, cq=%p\n",
octets,cp,cq);
while (*cp >= '0' && *cp <= '9')
cp++;
if (cp == cq || cp - cq > 3)
break;
if (*cp == '.' || octets == 3)
octets++;
if (octets < 4)
cp++;
cq = cp;
printk(KERN_ALERT "bottom: octets=%d, cp=%p, cq=%p\n",
octets,cp,cq);
}
And suddenly it worked! Very strange and my reason to be suspicious of
the compiler. If anyone has any suggestions on how to proceed and
generate a test case I would be glad to help diagnose wtf is going on.
--
Alex, Kernel Hacker: http://www.bennee.com/~alex/
panic("floppy: Port bolixed.");
2.2.16 /usr/src/linux/include/asm-sparc/floppy.h
------
Want more information? See the CrossGCC FAQ, http://www.objsw.com/CrossGCC/
Want to unsubscribe? Send a note to [email protected]