aboutsummaryrefslogtreecommitdiff
path: root/gcc/rtl.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2018-01-06 08:47:32 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2018-01-06 08:47:32 +0100
commit8fec4d222f0a35925bfdc4641612120b06d51c59 (patch)
tree952e2f159dfca22d9d68337bfb8c144769897cce /gcc/rtl.h
parentdba9c1fd276c07cd6a7cd432d71140931fa44c83 (diff)
downloadgcc-8fec4d222f0a35925bfdc4641612120b06d51c59.zip
gcc-8fec4d222f0a35925bfdc4641612120b06d51c59.tar.gz
gcc-8fec4d222f0a35925bfdc4641612120b06d51c59.tar.bz2
re PR rtl-optimization/83682 (ICE in simplify_subreg, at simplify-rtx.c:6296)
PR rtl-optimization/83682 * rtl.h (const_vec_duplicate_p): Only return true for VEC_DUPLICATE if it has non-VECTOR_MODE element mode. (vec_duplicate_p): Likewise. * gcc.target/i386/pr83682.c: New test. From-SVN: r256308
Diffstat (limited to 'gcc/rtl.h')
-rw-r--r--gcc/rtl.h7
1 files changed, 5 insertions, 2 deletions
diff --git a/gcc/rtl.h b/gcc/rtl.h
index 224dc96..71a81a2 100644
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2969,7 +2969,9 @@ const_vec_duplicate_p (T x, T *elt)
*elt = CONST_VECTOR_ENCODED_ELT (x, 0);
return true;
}
- if (GET_CODE (x) == CONST && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE)
+ if (GET_CODE (x) == CONST
+ && GET_CODE (XEXP (x, 0)) == VEC_DUPLICATE
+ && !VECTOR_MODE_P (GET_MODE (XEXP (XEXP (x, 0), 0))))
{
*elt = XEXP (XEXP (x, 0), 0);
return true;
@@ -2984,7 +2986,8 @@ template <typename T>
inline bool
vec_duplicate_p (T x, T *elt)
{
- if (GET_CODE (x) == VEC_DUPLICATE)
+ if (GET_CODE (x) == VEC_DUPLICATE
+ && !VECTOR_MODE_P (GET_MODE (XEXP (x, 0))))
{
*elt = XEXP (x, 0);
return true;