summaryrefslogtreecommitdiff
path: root/gcc/dse.c
diff options
context:
space:
mode:
authorRenlin Li <renlin.li@arm.com>2018-11-12 16:47:24 +0000
committerRenlin Li <renlin@gcc.gnu.org>2018-11-12 16:47:24 +0000
commite657564359c300bde7bcbba12e30b5e3f80f8c6c (patch)
tree4062e8bcf6db37a7a42f85411b47c89b727a2129 /gcc/dse.c
parentd5cc6de1be9d8fed0b810596efd467d6bee6aa03 (diff)
[PR87815]Don't generate shift sequence for load replacement in DSE when the mode size is not compile-time constant
The patch adds a check if the gap is compile-time constant. This happens when dse decides to replace the load with previous store value. The problem is that, shift sequence could not accept compile-time non-constant mode operand. gcc/ 2018-11-12 Renlin Li <renlin.li@arm.com> PR target/87815 * dse.c (get_stored_val): Add check for compile-time constantness of gap. gcc/testsuite/ 2018-11-12 Renlin Li <renlin.li@arm.com> PR target/87815 * gcc.target/aarch64/sve/pr87815.c: New. From-SVN: r266033
Diffstat (limited to 'gcc/dse.c')
-rw-r--r--gcc/dse.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gcc/dse.c b/gcc/dse.c
index cfebfa0e110..21d166d92fc 100644
--- a/gcc/dse.c
+++ b/gcc/dse.c
@@ -1841,7 +1841,7 @@ get_stored_val (store_info *store_info, machine_mode read_mode,
else
gap = read_offset - store_info->offset;
- if (maybe_ne (gap, 0))
+ if (gap.is_constant () && maybe_ne (gap, 0))
{
poly_int64 shift = gap * BITS_PER_UNIT;
poly_int64 access_size = GET_MODE_SIZE (read_mode) + gap;