
Dear Hector Palacios,
In message 523195CA.3010305@digi.com you wrote:
Here is a patch:
From: Robert Hodaszi robert.hodaszi@digi.com Date: Fri, 6 Sep 2013 09:50:52 +0200 Subject: [PATCH] net: fec: fix invalid temporary RX buffer alignment because of GCC bug
Older GCC versions don't handle well alignment on stack variables.
Can you please be specific - which exact versions of GCC are supposed to misbehave here?
To fix it, don't put the temporary onto the stack.
This is not a good idea, as it wastes a memory for no good reason.
Signed-off-by: Robert Hodaszi robert.hodaszi@digi.com Signed-off-by: Hector Palacios hector.palacios@digi.com
drivers/net/fec_mxc.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/net/fec_mxc.c b/drivers/net/fec_mxc.c index f4f72b7..315017e 100644 --- a/drivers/net/fec_mxc.c +++ b/drivers/net/fec_mxc.c @@ -828,7 +828,10 @@ static int fec_recv(struct eth_device *dev) uint16_t bd_status; uint32_t addr, size, end; int i;
uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
/* Don't place this variable on the stack, because older GCC version
* doesn't handle alignement on stack well.
*/
static uchar buff[FEC_MAX_PKT_SIZE] __aligned(ARCH_DMA_MINALIGN);
I have to admit that I doubt the explanation - somthing else is probaly wrong instead. I would really like to know which compiler version misbehaves, and what the generated code looks like, both in the working and in the broken case.
Thanks.
Best regards,
Wolfgang Denk