Subject: Re: kern/34751: regular panics in tcp_sack_option on NetBSD/alpha 3.0_STABLE
To: None <netbsd-bugs@NetBSD.org>
From: Christian Biere <christianbiere@gmx.de>
List: netbsd-bugs
Date: 10/09/2006 04:58:34
Izumi Tsutsui wrote:
> > Would you mind showing me the generated assembler code on Alpha anyway?
>
> der Mouse already provides right fix, I think.
> http://mail-index.netbsd.org/port-alpha/2006/10/08/0001.html
> (i.e. gcc assumes (uint32_t *) pointers are 4-byte aligned)
Not just GCC. That's basic C. I didn't look at that line but
(some_integer_type *) are almost always wrong. Obviously,
GCC warns about this by default and the author added the bogus
cast to suppress the valid warning.
My suggested patch wouldn't have fixed this but it's otherwise
correct and does certainly not fail on big endian machines.
peek_be32() et al. are rather useful functions. The only
downside is that GCC doesn't optimize them well.
--
Christian