[Bug target/89222] [7/8 regression] ARM thumb-2 misoptimisation of func ptr call with -O2 or -Os
wilco at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jul 16 12:37:00 GMT 2019
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89222
--- Comment #10 from Wilco <wilco at gcc dot gnu.org> ---
Author: wilco
Date: Tue Jul 16 12:37:14 2019
New Revision: 273526
URL: https://gcc.gnu.org/viewcvs?rev=273526&root=gcc&view=rev
Log:
[ARM] Fix PR89222
The GCC optimizer can generate symbols with non-zero offset from simple
if-statements. Bit zero is used for the Arm/Thumb state bit, so relocations
with offsets fail if it changes bit zero and the relocation forces bit zero
to true. The fix is to disable offsets on function pointer symbols.
gcc/
PR target/89222
* config/arm/arm.md (movsi): Use targetm.cannot_force_const_mem
to decide when to split off a non-zero offset from a symbol.
* config/arm/arm.c (arm_cannot_force_const_mem): Disallow offsets
in function symbols.
testsuite/
PR target/89222
* gcc.target/arm/pr89222.c: Add new test.
Added:
branches/gcc-8-branch/gcc/testsuite/gcc.target/arm/pr89222.c
Modified:
branches/gcc-8-branch/gcc/ChangeLog
branches/gcc-8-branch/gcc/config/arm/arm.c
branches/gcc-8-branch/gcc/config/arm/arm.md
branches/gcc-8-branch/gcc/testsuite/ChangeLog
More information about the Gcc-bugs
mailing list