]> git.ipfire.org Git - thirdparty/gcc.git/commit
[ARM] Fix PR89222
authorwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 15:04:01 +0000 (15:04 +0000)
committerwilco <wilco@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 5 Mar 2019 15:04:01 +0000 (15:04 +0000)
commiteeb22b66e910c56ca9325a7e1193ec54a4c55208
tree253d37b987d7417d008a27abf6398beaa5323df8
parentc06d4366f39edf5eafc5c0ccb11e997cc315ecd3
[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.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269390 138bc75d-0d04-0410-961f-82ee72b054a4
gcc/ChangeLog
gcc/config/arm/arm.c
gcc/config/arm/arm.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/arm/pr89222.c [new file with mode: 0644]