aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@linaro.org>2017-12-28 20:40:20 +0000
committerRichard Sandiford <rsandifo@gcc.gnu.org>2017-12-28 20:40:20 +0000
commitaf2e447568c939acf8c55eea529b2ac85c5753a7 (patch)
treea9682ab03a517c2a70ef33df8167d667e33d86da
parent4e48b472ed4ee625e68bcf5080d050151d6e3ab4 (diff)
downloadgcc-af2e447568c939acf8c55eea529b2ac85c5753a7.zip
gcc-af2e447568c939acf8c55eea529b2ac85c5753a7.tar.gz
gcc-af2e447568c939acf8c55eea529b2ac85c5753a7.tar.bz2
Use valid_for_const_vector_p instead of CONSTANT_P
This patch makes the VEC_SERIES code use valid_for_const_vector_p instead of CONSTANT_P, to match what we already do for VEC_DUPLICATE. This showed up as a failure in gcc.c-torture/execute/pr28982b.c for -m32 on x86_64-linux-gnu after later patches. 2017-12-28 Richard Sandiford <richard.sandiford@linaro.org> gcc/ * emit-rtl.c (gen_const_vec_series): Use valid_for_const_vector_p instead of CONSTANT_P. (gen_vec_series): Likewise. * simplify-rtx.c (simplify_binary_operation_1): Likewise. From-SVN: r256023
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/emit-rtl.c6
-rw-r--r--gcc/simplify-rtx.c3
3 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index b0dabfb..680a63a 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2017-12-28 Richard Sandiford <richard.sandiford@linaro.org>
+
+ * emit-rtl.c (gen_const_vec_series): Use valid_for_const_vector_p
+ instead of CONSTANT_P.
+ (gen_vec_series): Likewise.
+ * simplify-rtx.c (simplify_binary_operation_1): Likewise.
+
2017-12-28 Andreas Schwab <schwab@linux-m68k.org>
* config/m68k/m68k.md (ashrdi3_const1, lshrdi3_const1): Add
diff --git a/gcc/emit-rtl.c b/gcc/emit-rtl.c
index 53693bd..2084701 100644
--- a/gcc/emit-rtl.c
+++ b/gcc/emit-rtl.c
@@ -5949,7 +5949,8 @@ const_vec_series_p_1 (const_rtx x, rtx *base_out, rtx *step_out)
rtx
gen_const_vec_series (machine_mode mode, rtx base, rtx step)
{
- gcc_assert (CONSTANT_P (base) && CONSTANT_P (step));
+ gcc_assert (valid_for_const_vector_p (mode, base)
+ && valid_for_const_vector_p (mode, step));
int nunits = GET_MODE_NUNITS (mode);
rtvec v = rtvec_alloc (nunits);
@@ -5970,7 +5971,8 @@ gen_vec_series (machine_mode mode, rtx base, rtx step)
{
if (step == const0_rtx)
return gen_vec_duplicate (mode, base);
- if (CONSTANT_P (base) && CONSTANT_P (step))
+ if (valid_for_const_vector_p (mode, base)
+ && valid_for_const_vector_p (mode, step))
return gen_const_vec_series (mode, base, step);
return gen_rtx_VEC_SERIES (mode, base, step);
}
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c
index 6b163f9..e5cfd3d 100644
--- a/gcc/simplify-rtx.c
+++ b/gcc/simplify-rtx.c
@@ -3590,7 +3590,8 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
case VEC_SERIES:
if (op1 == CONST0_RTX (GET_MODE_INNER (mode)))
return gen_vec_duplicate (mode, op0);
- if (CONSTANT_P (op0) && CONSTANT_P (op1))
+ if (valid_for_const_vector_p (mode, op0)
+ && valid_for_const_vector_p (mode, op1))
return gen_const_vec_series (mode, op0, op1);
return 0;