Aliasing problem in ip_input.c with GCC 4.6 on PowerPC?

Sebastian Huber sebastian.huber at embedded-brains.de
Fri May 27 16:48:43 UTC 2011


On 25/05/11 17:14, Till Straumann wrote:
> Is it our old friend in_cksum_hdr() ?

Was this the old friend that doesn't work with optimization disabled? 
The problem I encountered appears if I use the -fstrict-aliasing
optimization (enabled with -O2).  The mbufs get corrupted in
ip_input().  Here is a sample difference between the assembler code
generated with -fstrict-aliasing and with -fno-strict-aliasing:

+.LBB50:
        .loc 1 839 0
        lwz 11,16(9)     # <variable>.ipf_prev, <variable>.ipf_prev
        stw 31,12(11)    # <variable>.ipf_next, p
        .loc 1 840 0
-       lwz 11,12(9)     # <variable>.ipf_next, <variable>.ipf_next
-       lwz 0,16(9)      # <variable>.ipf_prev, <variable>.ipf_prev
-       stw 0,16(11)     # <variable>.ipf_prev, <variable>.ipf_prev
+       lwz 9,12(9)      # <variable>.ipf_next, <variable>.ipf_next
+.LVL34:
+       stw 11,16(9)     # <variable>.ipf_prev, <variable>.ipf_prev
+.LBE50:


>
> Till
>
>
> On 05/25/2011 06:28 AM, Sebastian Huber wrote:
>> Hello,
>>
>> experienced someone network problems with GCC 4.6 on PowerPC?  I have
>> a test
>> application that works fine with ip_input.c compiled with "-O2
>> -fno-strict-aliasing" and fails with "-O2 -fstrict-aliasing". 
>> Unfortunately
>> the difference between the two generated assembler files is quite
>> huge.  The
>> option -Wstrict-aliasing=1 yields no warnings.
>>
>> Have a nice day!
>>
>
> _______________________________________________
> rtems-users mailing list
> rtems-users at rtems.org
> http://www.rtems.org/mailman/listinfo/rtems-users




More information about the users mailing list