This is the mail archive of the crossgcc@sources.redhat.com mailing list for the crossgcc project.

See the CrossGCC FAQ for lots more information.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Weird behaviour, possible compiler bug?


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 crossgcc-unsubscribe@sources.redhat.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]