Thread (20 messages) flat view 20 messages, 5 authors, 2012-05-24

Re: [RFC] net/hsr: Add support for IEC 62439-3 High-availability Seamless Redundancy

From: Arvid Brodin <hidden>
Date: 2012-04-06 15:51:35

David Miller wrote:
From: Stephen Hemminger <redacted>
Date: Wed, 4 Apr 2012 16:55:59 -0700
quoted
That isn't so bad, doing a memcpy versus a structure copy.
GCC is going to inline the memcpy and thus we'll still do the
unaligned accesses.  This change therefore won't fix the problem.
Well, it does work for me, with gcc-4.2.2-compiled linux-2.6.37 running
on an AVR32 board.

Just out of curiosity, what's the mechanism behind this inline
assignment that turns the memcpy into an unaligned access? If gcc is 
"smart" enough to detect a bunch of char * accesses and turn them 
into unaligned 32-bit accesses, isn't that a bug in gcc?

Or will this only happen on archs which __HAVE_ARCH_MEMCPY? (But looking
at a couple of arch/xxx/lib/string.c, these too seem to take alignment
into account.)

-- 
Arvid Brodin
Enea Services Stockholm AB - since February 16 a part of Xdin in the Alten
Group. Soon we will be working under the common brand Xdin. Read more at
www.xdin.com.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help