[Bug target/112573] Suboptimal code generation with `-fdata-sections` on aarch64

jwerner at chromium dot org gcc-bugzilla@gcc.gnu.org
Thu Nov 16 22:11:53 GMT 2023


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

--- Comment #2 from Julius Werner <jwerner at chromium dot org> ---
Sorry, I don't really know what reassociation means in this context. Are you
saying that the behavior is WAI?

Note that the problem also exists when you write the accesses in h() as:

        *(a + (y + 3)) = (char)x;

so I don't really think this is just an order-of-operations / overflow thing
(also, how would that explain why it only occurs with -fdata-sections?).
According to my understanding of C, `*(a + (y + 3))` and `a[y + 3]` are
different notations for exactly the same expression, so they shouldn't generate
different code.


More information about the Gcc-bugs mailing list