[Bug tree-optimization/106064] Wrong code comparing two global zero-sized arrays

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Jun 24 10:20:38 GMT 2022


--- Comment #3 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
(In reply to Mikael Pettersson from comment #2)
> Seems target-dependent. I can't reproduce on x86_64-linux-gnu or
> sparc64-linux-gnu: both compile f() to return 1 and g() to perform a runtime
> computation. But ppc64-linux-gnu and armv7l-linux-gnueabi behave as your
> aarch64 example: f() returns 1 and g() returns 0 (unconditionally, no
> runtime computations).

Most likely section anchors is the cause of the difference between the targets.
The ones which implement section anchors return different values between the
functions. Is suspect MIPS has similar behavior too.

More information about the Gcc-bugs mailing list