[Bug tree-optimization/95396] [8/9/10/11 Regression] GCC produces incorrect code with -O3 for loops since r8-6511-g3ae129323d150621

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Tue Jul 7 08:00:53 GMT 2020


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95396

--- Comment #5 from Richard Biener <rguenth at gcc dot gnu.org> ---
Creating dr for arr_26[_5]
analyze_innermost: success.
        base_address: &arr_26
        offset from base address: (ssizetype) ((sizetype) (char) _3 * 2)
        constant offset from base address: -482
        step: 2
        base alignment: 32
        base misalignment: 0
        offset alignment: 2
        step alignment: 2
        base_object: arr_26
        Access function 0: {(int) e_12, +, 1}_1

the constant offset is odd and indeed we end up storing outside of the
array:

10              arr_26[e] = 42;
(gdb) p/x $rax + 0x601860
$2 = 0x601660
(gdb) p &arr_26
$3 = (unsigned short (*)[20]) 0x601860 <arr_26>


More information about the Gcc-bugs mailing list