summaryrefslogtreecommitdiff
path: root/gcc/tree-cfg.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-29 18:03:58 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2009-04-29 18:03:58 +0000
commit8f93c289f97e7fe310c40019082c939184582878 (patch)
tree8f3fe70526785c92b8d30116c2b5c889fb7d961f /gcc/tree-cfg.c
parent4ef1170b5e8bddbaa04cbcb5846dd4bfdc30aee0 (diff)
downloadgcc-8f93c289f97e7fe310c40019082c939184582878.tar.gz
2009-04-29 Richard Guenther <rguenther@suse.de>
* tree-cfg.c (verify_gimple_assign_binary): Allow vector shifts of floating point vectors if the shift amount is a constant multiple of the element size. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@146983 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-cfg.c')
-rw-r--r--gcc/tree-cfg.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/gcc/tree-cfg.c b/gcc/tree-cfg.c
index 0ef2fb9b881..b5c67cd8a08 100644
--- a/gcc/tree-cfg.c
+++ b/gcc/tree-cfg.c
@@ -3560,7 +3560,8 @@ verify_gimple_assign_binary (gimple stmt)
{
if (TREE_CODE (rhs1_type) != VECTOR_TYPE
|| !(INTEGRAL_TYPE_P (TREE_TYPE (rhs1_type))
- || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type)))
+ || FIXED_POINT_TYPE_P (TREE_TYPE (rhs1_type))
+ || SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type)))
|| (!INTEGRAL_TYPE_P (rhs2_type)
&& (TREE_CODE (rhs2_type) != VECTOR_TYPE
|| !INTEGRAL_TYPE_P (TREE_TYPE (rhs2_type))))
@@ -3572,6 +3573,16 @@ verify_gimple_assign_binary (gimple stmt)
debug_generic_expr (rhs2_type);
return true;
}
+ /* For shifting a vector of floating point components we
+ only allow shifting by a constant multiple of the element size. */
+ if (SCALAR_FLOAT_TYPE_P (TREE_TYPE (rhs1_type))
+ && (TREE_CODE (rhs2) != INTEGER_CST
+ || !div_if_zero_remainder (EXACT_DIV_EXPR, rhs2,
+ TYPE_SIZE (TREE_TYPE (rhs1_type)))))
+ {
+ error ("non-element sized vector shift of floating point vector");
+ return true;
+ }
return false;
}