diff options
author | Eric Botcazou <ebotcazou@adacore.com> | 2015-02-04 21:59:08 +0000 |
---|---|---|
committer | Eric Botcazou <ebotcazou@gcc.gnu.org> | 2015-02-04 21:59:08 +0000 |
commit | 5a33f47d99d787af43fc8b27c29cea4e5c1432d8 (patch) | |
tree | 25725ac20df4957f9e7f5c24b4e5c09d2bb0fea1 /gcc/tree-ssa-loop-ivopts.c | |
parent | 0b986c6ac777aa4ecbfa29549148ef8ab95595e1 (diff) | |
download | gcc-5a33f47d99d787af43fc8b27c29cea4e5c1432d8.zip gcc-5a33f47d99d787af43fc8b27c29cea4e5c1432d8.tar.gz gcc-5a33f47d99d787af43fc8b27c29cea4e5c1432d8.tar.bz2 |
* tree-ssa-loop-ivopts.c (get_address_cost): Use right mode for offset.
From-SVN: r220419
Diffstat (limited to 'gcc/tree-ssa-loop-ivopts.c')
-rw-r--r-- | gcc/tree-ssa-loop-ivopts.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/gcc/tree-ssa-loop-ivopts.c b/gcc/tree-ssa-loop-ivopts.c index d50adb0..bde68e7 100644 --- a/gcc/tree-ssa-loop-ivopts.c +++ b/gcc/tree-ssa-loop-ivopts.c @@ -3324,12 +3324,12 @@ get_address_cost (bool symbol_present, bool var_present, XEXP (addr, 1) = gen_int_mode (off, address_mode); if (memory_address_addr_space_p (mem_mode, addr, as)) break; - /* For some TARGET, like ARM THUMB1, the offset should be nature - aligned. Try an aligned offset if address_mode is not QImode. */ - off = (address_mode == QImode) - ? 0 - : ((unsigned HOST_WIDE_INT) 1 << i) - - GET_MODE_SIZE (address_mode); + /* For some strict-alignment targets, the offset must be naturally + aligned. Try an aligned offset if mem_mode is not QImode. */ + off = mem_mode != QImode + ? ((unsigned HOST_WIDE_INT) 1 << i) + - GET_MODE_SIZE (mem_mode) + : 0; if (off > 0) { XEXP (addr, 1) = gen_int_mode (off, address_mode); |