diff options
author | Kyrylo Tkachov <kyrylo.tkachov@arm.com> | 2015-03-12 13:40:50 +0000 |
---|---|---|
committer | Kyrylo Tkachov <ktkachov@gcc.gnu.org> | 2015-03-12 13:40:50 +0000 |
commit | 644f6fd80a917eba98498079a9e6e2758198d6cb (patch) | |
tree | ba93d162074f6056498beb393eae670a323c4152 /gcc/simplify-rtx.c | |
parent | 6899585abf17b4e39856cfad454b8cb21424838f (diff) | |
download | gcc-644f6fd80a917eba98498079a9e6e2758198d6cb.zip gcc-644f6fd80a917eba98498079a9e6e2758198d6cb.tar.gz gcc-644f6fd80a917eba98498079a9e6e2758198d6cb.tar.bz2 |
[simplify-rtx] PR 65235: Calculate element size correctly when simplifying (vec_select (vec_concat (const_int) (...)) [...])
PR rtl-optimization 65235
* simplify-rtx.c (simplify_binary_operation_1, VEC_SELECT case):
When first element of vec_concat is const_int, calculate its size
using second element.
PR rtl-optimization 65235
* gcc.target/aarch64/pr65235_1.c: New test.
From-SVN: r221387
Diffstat (limited to 'gcc/simplify-rtx.c')
-rw-r--r-- | gcc/simplify-rtx.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gcc/simplify-rtx.c b/gcc/simplify-rtx.c index a003b41..5d17498 100644 --- a/gcc/simplify-rtx.c +++ b/gcc/simplify-rtx.c @@ -3555,7 +3555,21 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode, while (GET_MODE (vec) != mode && GET_CODE (vec) == VEC_CONCAT) { - HOST_WIDE_INT vec_size = GET_MODE_SIZE (GET_MODE (XEXP (vec, 0))); + HOST_WIDE_INT vec_size; + + if (CONST_INT_P (XEXP (vec, 0))) + { + /* vec_concat of two const_ints doesn't make sense with + respect to modes. */ + if (CONST_INT_P (XEXP (vec, 1))) + return 0; + + vec_size = GET_MODE_SIZE (GET_MODE (trueop0)) + - GET_MODE_SIZE (GET_MODE (XEXP (vec, 1))); + } + else + vec_size = GET_MODE_SIZE (GET_MODE (XEXP (vec, 0))); + if (offset < vec_size) vec = XEXP (vec, 0); else |