https://bugs.kde.org/show_bug.cgi?id=444571

--- Comment #11 from Mark Wielaard <m...@klomp.org> ---
yeah, the fedora 35 gcc generates:

6         char x = a[-1];
   0x000000001000071c <+48>:    ld      r9,32(r31)
   0x0000000010000720 <+52>:    lbz     r9,-1(r9)
   0x0000000010000724 <+56>:    stb     r9,40(r31)
   0x0000000010000728 <+60>:    li      r9,0

which valgrind does catch:

==15687== Invalid read of size 1
==15687==    at 0x10000720: main (b.c:6)
==15687==  Address 0x436003f is 1 bytes before a block of size 1 alloc'd
==15687==    at 0x40A5344: malloc (vg_replace_malloc.c:380)
==15687==    by 0x1000070F: main (b.c:5)

I can replicate when using gcc -mcpu=power9 -g -o b b.c

6         char x = a[-1];
   0x000000001000071c <+48>:    ld      r9,32(r31)
   0x0000000010000720 <+52>:    addi    r9,r9,-1
   0x0000000010000724 <+56>:    lxsibzx vs0,0,r9
   0x0000000010000728 <+60>:    addi    r9,r31,40
   0x000000001000072c <+64>:    stxsibx vs0,0,r9
   0x0000000010000730 <+68>:    li      r9,0

So I guess that the difference is the default -mcpu setting between gcc
versions

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to