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

Marcin Juszkiewicz <mjuszkiewicz at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |mjuszkiewicz at redhat dot com

--- Comment #9 from Marcin Juszkiewicz <mjuszkiewicz at redhat dot com> ---
Nicolas Pitre (author of kernel patch) wrote to me:

OK. I played with the reduced test case a bit.  Here's an even smaller 
test case you could add to the bug entry:

extern void bar(void);
void foo(void)
{
 unsigned long fn_addr = ((unsigned long)&bar) & 3;
 ((unsigned int *)fn_addr)[0] = 5;
 ((unsigned int *)fn_addr)[1] = 6;
}

The generated assembly is:

        ldr     r3, .L2
        mov     r2, #6
        and     r3, r3, #3
        str     r2, [r3, #4]
        bx      lr
.L3:
        .align  2
.L2:
        .word   bar

As you can see, the value 5 is dropped.

Let's hope gcc will be fixed.

Reply via email to