aboutsummaryrefslogtreecommitdiff
path: root/gcc/varasm.c
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-10-26 11:28:25 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-10-26 11:28:25 +0000
commitf073de07ad00d4be604bdbaeab14786850932601 (patch)
tree825db4f6d56d10a34af45d9e3c9e8dcaf128e151 /gcc/varasm.c
parent4bc19a3b1a9fe74e515b7c54082bbad27decc227 (diff)
downloadgcc-f073de07ad00d4be604bdbaeab14786850932601.zip
gcc-f073de07ad00d4be604bdbaeab14786850932601.tar.gz
gcc-f073de07ad00d4be604bdbaeab14786850932601.tar.bz2
This patch adds a new hook that gives the preferred alignment for a static rtx...
TARGET_STATIC_RTX_ALIGNMENT This patch adds a new hook that gives the preferred alignment for a static rtx, so that we don't need to query the front end in force_const_mem. 2017-10-26 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * target.def (static_rtx_alignment): New hook. * targhooks.h (default_static_rtx_alignment): Declare. * targhooks.c (default_static_rtx_alignment): New function. * doc/tm.texi.in (TARGET_STATIC_RTX_ALIGNMENT): New hook. * doc/tm.texi: Regenerate. * varasm.c (force_const_mem): Use targetm.static_rtx_alignment instead of targetm.constant_alignment. Remove call to set_mem_attributes. * config/cris/cris.c (TARGET_STATIC_RTX_ALIGNMENT): Redefine. (cris_preferred_mininum_alignment): New function, split out from... (cris_constant_alignment): ...here. (cris_static_rtx_alignment): New function. * config/i386/i386.c (ix86_static_rtx_alignment): New function, split out from... (ix86_constant_alignment): ...here. (TARGET_STATIC_RTX_ALIGNMENT): Redefine. * config/mmix/mmix.c (TARGET_STATIC_RTX_ALIGNMENT): Redefine. (mmix_static_rtx_alignment): New function. * config/spu/spu.c (spu_static_rtx_alignment): New function. (TARGET_STATIC_RTX_ALIGNMENT): Redefine. From-SVN: r254102
Diffstat (limited to 'gcc/varasm.c')
-rw-r--r--gcc/varasm.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/gcc/varasm.c b/gcc/varasm.c
index d324ca03..a139151 100644
--- a/gcc/varasm.c
+++ b/gcc/varasm.c
@@ -3783,11 +3783,8 @@ force_const_mem (machine_mode mode, rtx x)
*slot = desc;
/* Align the location counter as required by EXP's data type. */
- align = GET_MODE_ALIGNMENT (mode == VOIDmode ? word_mode : mode);
-
- tree type = lang_hooks.types.type_for_mode (mode, 0);
- if (type != NULL_TREE)
- align = targetm.constant_alignment (make_tree (type, x), align);
+ machine_mode align_mode = (mode == VOIDmode ? word_mode : mode);
+ align = targetm.static_rtx_alignment (align_mode);
pool->offset += (align / BITS_PER_UNIT) - 1;
pool->offset &= ~ ((align / BITS_PER_UNIT) - 1);
@@ -3829,7 +3826,6 @@ force_const_mem (machine_mode mode, rtx x)
/* Construct the MEM. */
desc->mem = def = gen_const_mem (mode, symbol);
- set_mem_attributes (def, lang_hooks.types.type_for_mode (mode, 0), 1);
set_mem_align (def, align);
/* If we're dropping a label to the constant pool, make sure we