This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug target/79041] aarch64 backend emits R_AARCH64_ADR_PREL_PG_HI21 relocation despite -mpc-relative-literal-loads option being used
- From: "wilco at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 25 Jul 2017 12:09:31 +0000
- Subject: [Bug target/79041] aarch64 backend emits R_AARCH64_ADR_PREL_PG_HI21 relocation despite -mpc-relative-literal-loads option being used
- Auto-submitted: auto-generated
- References: <bug-79041-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79041
--- Comment #8 from Wilco <wilco at gcc dot gnu.org> ---
Author: wilco
Date: Tue Jul 25 12:08:59 2017
New Revision: 250514
URL: https://gcc.gnu.org/viewcvs?rev=250514&root=gcc&view=rev
Log:
Fix PR79041
As described in PR79041, -mcmodel=large -mpc-relative-literal-loads
may be used to avoid generating ADRP/ADD or ADRP/LDR. However both
trunk and GCC7 may still emit ADRP for some constant pool literals.
Fix this by adding a aarch64_pcrelative_literal_loads check.
gcc/
PR target/79041
* config/aarch64/aarch64.c (aarch64_classify_symbol):
Avoid SYMBOL_SMALL_ABSOLUTE for literals with pc-relative literals.
gcc/testsuite/
* gcc.target/aarch64/pr79041-2.c: New test.
Added:
branches/gcc-7-branch/gcc/testsuite/gcc.target/aarch64/pr79041-2.c
Modified:
branches/gcc-7-branch/gcc/ChangeLog
branches/gcc-7-branch/gcc/config/aarch64/aarch64.c
branches/gcc-7-branch/gcc/testsuite/ChangeLog