https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71509
luoxhu at gcc dot gnu.org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |luoxhu at gcc dot gnu.org --- Comment #11 from luoxhu at gcc dot gnu.org --- (In reply to Anton Blanchard from comment #4) > Created attachment 39683 [details] > Another bitop LHS test case > > Here's another issue found in the Linux kernel. Seems like this should be a > single lwz/stw since the union of counter and the bitops completely overlap. > > The half word store followed by word load is going to prevent it from store > forwarding. > > 0000000000000000 <set_page_slub_counters>: > 0: 00 00 03 81 lwz r8,0(r3) > 4: 20 00 89 78 clrldi r9,r4,32 > 8: c2 0f 2a 79 rldicl r10,r9,33,31 > c: 00 f8 48 51 rlwimi r8,r10,31,0,0 > 10: 5e 00 2a 55 rlwinm r10,r9,0,1,15 > 14: 00 00 03 91 stw r8,0(r3) > 18: 00 00 83 b0 sth r4,0(r3) > 1c: 00 00 42 60 ori r2,r2,0 > 20: 00 00 23 81 lwz r9,0(r3) > 24: 00 04 29 55 rlwinm r9,r9,0,16,0 > 28: 78 53 29 7d or r9,r9,r10 > 2c: 00 00 23 91 stw r9,0(r3) > 30: 20 00 80 4e blr This case only is fixed on latest gcc 10 already (issues in case __skb_decr_checksum_unnecessary from Anton Blanchard and test2 from Nicholas Piggin still exist). gcc version 10.0.1 20200210 objdump -d set_page_slub_counters.o set_page_slub_counters.o: file format elf64-powerpcle Disassembly of section .text: 0000000000000000 <set_page_slub_counters>: 0: 22 84 89 78 rldicl r9,r4,48,48 4: 00 00 83 b0 sth r4,0(r3) 8: 02 00 23 b1 sth r9,2(r3) c: 20 00 80 4e blr