Messages in this thread | | | Date | Mon, 22 Mar 2004 19:36:28 -0800 | From | Paul Jackson <> | Subject | Re: [PATCH] Introduce nodemask_t ADT [0/7] |
| |
> gcc flat out miscompiled such inlines last I checked (Zwane shipped the > bugreport IIRC).
The one error I've heard tell of recently is one that Andi Kleen hit in include/linux/bitmap.h. He had to compute the copy length explicitly in a separate variable, or gcc forgot to do it (I forget the details). The change is:
static inline void bitmap_copy(unsigned long *dst, const unsigned long *src, int bits) { - memcpy(dst, src, BITS_TO_LONGS(bits)*sizeof(unsigned long)); + int len = BITS_TO_LONGS(bits)*sizeof(unsigned long); + memcpy(dst, src, len); }
Do you have any more pointers/info on the miscompile you quote above? Like - how long ago - what gcc version ...
It would be an insult to wrap the entire cpumask design around the axle of such non-specific allegations of gcc misconduct. Better to get the API right, and then deal with specific tool bugs as necessary.
Or, as Linus might say (did say, in a quite different context):
Never _ever_ make your source-code look worse because your tools suck. Fix the tools instead.
-- I won't rest till it's the best ... Programmer, Linux Scalability Paul Jackson <pj@sgi.com> 1.650.933.1373 - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |