aboutsummaryrefslogtreecommitdiff
path: root/gcc/expr.c
diff options
context:
space:
mode:
authorTamar Christina <tamar.christina@arm.com>2017-11-17 10:47:52 +0000
committerTamar Christina <tnfchris@gcc.gnu.org>2017-11-17 10:47:52 +0000
commit6f203500991046555099e72ca8794d60d50ef41d (patch)
treed3c3f38c9249ec3af301a9a59de5074e880813bf /gcc/expr.c
parent7326cf0fb08b1977171aa97bc8370d950129c813 (diff)
downloadgcc-6f203500991046555099e72ca8794d60d50ef41d.zip
gcc-6f203500991046555099e72ca8794d60d50ef41d.tar.gz
gcc-6f203500991046555099e72ca8794d60d50ef41d.tar.bz2
expr.c (copy_blkmode_to_reg): Fix bitsize for targets with fast unaligned access.
2017-11-17 Tamar Christina <tamar.christina@arm.com> * expr.c (copy_blkmode_to_reg): Fix bitsize for targets with fast unaligned access. * doc/sourcebuild.texi (word_mode_no_slow_unalign): New. gcc/testsuite/ 2017-11-17 Tamar Christina <tamar.christina@arm.com> * gcc.dg/struct-simple.c: New. * lib/target-supports.exp (check_effective_target_word_mode_no_slow_unalign): New. From-SVN: r254862
Diffstat (limited to 'gcc/expr.c')
-rw-r--r--gcc/expr.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/expr.c b/gcc/expr.c
index 76684c1..c93d9f6 100644
--- a/gcc/expr.c
+++ b/gcc/expr.c
@@ -2772,7 +2772,9 @@ copy_blkmode_to_reg (machine_mode mode_in, tree src)
n_regs = (bytes + UNITS_PER_WORD - 1) / UNITS_PER_WORD;
dst_words = XALLOCAVEC (rtx, n_regs);
- bitsize = MIN (TYPE_ALIGN (TREE_TYPE (src)), BITS_PER_WORD);
+ bitsize = BITS_PER_WORD;
+ if (targetm.slow_unaligned_access (word_mode, TYPE_ALIGN (TREE_TYPE (src))))
+ bitsize = MIN (TYPE_ALIGN (TREE_TYPE (src)), BITS_PER_WORD);
/* Copy the structure BITSIZE bits at a time. */
for (bitpos = 0, xbitpos = padding_correction;