aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2018-11-13 23:31:36 +1030
committerAlan Modra <amodra@gcc.gnu.org>2018-11-13 23:31:36 +1030
commita277ca89ac37a0da1f8e6a92fc3b591e2385dd77 (patch)
tree2a532104736c20106cbc302ff7b506dbedb654b1
parent9de6af4572105dbe63074d09b8c322464daec2e7 (diff)
downloadgcc-a277ca89ac37a0da1f8e6a92fc3b591e2385dd77.zip
gcc-a277ca89ac37a0da1f8e6a92fc3b591e2385dd77.tar.gz
gcc-a277ca89ac37a0da1f8e6a92fc3b591e2385dd77.tar.bz2
[RS6000] Don't put large integer constants in TOC for -mcmodel=medium
For -mcmodel=medium we can use toc-relative addressing to access constants placed in read-only data, which is better since they can be merged when in .rodata.cst8. * config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Exclude integer constants when -mcmodel=medium. From-SVN: r266069
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/rs6000/linux64.h7
2 files changed, 10 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3f94aeb..369ef54 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2018-11-13 Alan Modra <amodra@gmail.com>
+
+ * config/rs6000/linux64.h (ASM_OUTPUT_SPECIAL_POOL_ENTRY_P): Exclude
+ integer constants when -mcmodel=medium.
+
2018-11-13 Claudiu Zissulescu <claziss@synopsys.com>
* config/arc/arc.h (FUNCTION_PROFILER): Redefine to empty.
diff --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
index e6b4fd2..0d8e164 100644
--- a/gcc/config/rs6000/linux64.h
+++ b/gcc/config/rs6000/linux64.h
@@ -582,8 +582,10 @@ extern int dot_symbols;
we also do this for floating-point constants. We actually can only
do this if the FP formats of the target and host machines are the
same, but we can't check that since not every file that uses
- the macros includes real.h. We also do this when we can write the
- entry into the TOC and the entry is not larger than a TOC entry. */
+ the macros includes real.h. We also do this when we can write an
+ integer into the TOC and the entry is not larger than a TOC entry,
+ but not for -mcmodel=medium where we'll use a toc-relative load for
+ constants outside the TOC. */
#undef ASM_OUTPUT_SPECIAL_POOL_ENTRY_P
#define ASM_OUTPUT_SPECIAL_POOL_ENTRY_P(X, MODE) \
@@ -593,6 +595,7 @@ extern int dot_symbols;
&& GET_CODE (XEXP (XEXP (X, 0), 0)) == SYMBOL_REF) \
|| GET_CODE (X) == LABEL_REF \
|| (GET_CODE (X) == CONST_INT \
+ && TARGET_CMODEL != CMODEL_MEDIUM \
&& GET_MODE_BITSIZE (MODE) <= GET_MODE_BITSIZE (Pmode)) \
|| (GET_CODE (X) == CONST_DOUBLE \
&& ((TARGET_64BIT \