From: Jakub Jelinek Date: Tue, 29 May 2018 12:01:26 +0000 (+0200) Subject: tree-cfg.c (verify_gimple_assign_unary): Add checking for VEC_UNPACK_*_EXPR. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e379122d1f078d230514ff862c4f9053c2898af4;p=gcc.git tree-cfg.c (verify_gimple_assign_unary): Add checking for VEC_UNPACK_*_EXPR. * tree-cfg.c (verify_gimple_assign_unary): Add checking for VEC_UNPACK_*_EXPR. (verify_gimple_assign_binary): Check TYPE_VECTOR_SUBPARTS for VEC_PACK_*_EXPR. From-SVN: r260894 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 6a3747c929a..2a3094b2164 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,10 @@ 2018-05-29 Jakub Jelinek + * tree-cfg.c (verify_gimple_assign_unary): Add checking for + VEC_UNPACK_*_EXPR. + (verify_gimple_assign_binary): Check TYPE_VECTOR_SUBPARTS for + VEC_PACK_*_EXPR. + PR target/85918 * tree.def (VEC_UNPACK_FIX_TRUNC_HI_EXPR, VEC_UNPACK_FIX_TRUNC_LO_EXPR, VEC_PACK_FLOAT_EXPR): New tree codes. diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c index ab2feed19d5..4a1b2bef570 100644 --- a/gcc/tree-cfg.c +++ b/gcc/tree-cfg.c @@ -3678,7 +3678,37 @@ verify_gimple_assign_unary (gassign *stmt) case VEC_UNPACK_FLOAT_LO_EXPR: case VEC_UNPACK_FIX_TRUNC_HI_EXPR: case VEC_UNPACK_FIX_TRUNC_LO_EXPR: - /* FIXME. */ + if (TREE_CODE (rhs1_type) != VECTOR_TYPE + || TREE_CODE (lhs_type) != VECTOR_TYPE + || (!INTEGRAL_TYPE_P (TREE_TYPE (lhs_type)) + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (lhs_type))) + || (!INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type)) + && !SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type))) + || ((rhs_code == VEC_UNPACK_HI_EXPR + || rhs_code == VEC_UNPACK_LO_EXPR) + && (INTEGRAL_TYPE_P (TREE_TYPE (lhs_type)) + != INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type)))) + || ((rhs_code == VEC_UNPACK_FLOAT_HI_EXPR + || rhs_code == VEC_UNPACK_FLOAT_LO_EXPR) + && (INTEGRAL_TYPE_P (TREE_TYPE (lhs_type)) + || SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type)))) + || ((rhs_code == VEC_UNPACK_FIX_TRUNC_HI_EXPR + || rhs_code == VEC_UNPACK_FIX_TRUNC_LO_EXPR) + && (INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type)) + || SCALAR_FLOAT_TYPE_P (TREE_TYPE (lhs_type)))) + || (maybe_ne (GET_MODE_SIZE (element_mode (lhs_type)), + 2 * GET_MODE_SIZE (element_mode (rhs1_type))) + && (!VECTOR_BOOLEAN_TYPE_P (lhs_type) + || !VECTOR_BOOLEAN_TYPE_P (rhs1_type))) + || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (lhs_type), + TYPE_VECTOR_SUBPARTS (rhs1_type))) + { + error ("type mismatch in vector unpack expression"); + debug_generic_expr (lhs_type); + debug_generic_expr (rhs1_type); + return true; + } + return false; case NEGATE_EXPR: @@ -3993,7 +4023,9 @@ verify_gimple_assign_binary (gassign *stmt) == INTEGRAL_TYPE_P (TREE_TYPE (lhs_type)))) || !types_compatible_p (rhs1_type, rhs2_type) || maybe_ne (GET_MODE_SIZE (element_mode (rhs1_type)), - 2 * GET_MODE_SIZE (element_mode (lhs_type)))) + 2 * GET_MODE_SIZE (element_mode (lhs_type))) + || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (rhs1_type), + TYPE_VECTOR_SUBPARTS (lhs_type))) { error ("type mismatch in vector pack expression"); debug_generic_expr (lhs_type); @@ -4012,7 +4044,9 @@ verify_gimple_assign_binary (gassign *stmt) || !SCALAR_FLOAT_TYPE_P (TREE_TYPE (lhs_type)) || !types_compatible_p (rhs1_type, rhs2_type) || maybe_ne (GET_MODE_SIZE (element_mode (rhs1_type)), - 2 * GET_MODE_SIZE (element_mode (lhs_type)))) + 2 * GET_MODE_SIZE (element_mode (lhs_type))) + || maybe_ne (2 * TYPE_VECTOR_SUBPARTS (rhs1_type), + TYPE_VECTOR_SUBPARTS (lhs_type))) { error ("type mismatch in vector pack expression"); debug_generic_expr (lhs_type);