gcc miscompiles csum_tcpudp_magic() on ARMv5

Måns Rullgård mans at mansr.com
Thu Dec 12 10:50:45 EST 2013


Russell King - ARM Linux <linux at arm.linux.org.uk> writes:

> On Thu, Dec 12, 2013 at 04:28:49PM +0100, Willy Tarreau wrote:
>> On Thu, Dec 12, 2013 at 03:18:18PM +0000, Måns Rullgård wrote:
>> > The ABI for function calls sign/zero-extends all arguments prior to the
>> > call.
>> 
>> OK then that's pretty clear, there's no ambiguity, thanks for the precision.
>
> Let's be clear about this: there is no GCC bug here - the kernel code
> unfortunately what is buggy.  asm() input arguments are not subject to
> this promotion irrespective of the ABI.

At the asm() the value should already have been zero-extended.  Since
the code does not do anything with undefined behaviour, the fact that
different optimisation levels give different results clearly indicates a
compiler bug.

-- 
Måns Rullgård
mans at mansr.com



More information about the linux-arm-kernel mailing list