aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRichard Guenther <rguenther@suse.de>2011-10-05 12:25:35 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2011-10-05 12:25:35 +0000
commit18474649d91dd922555c5af509206a7aa3c65285 (patch)
tree5a59d3a5e2025d2b5ffb3b9119b3182a49ee0282 /gcc
parent4c4973ab36452aaa21c473d9dac993ef74fc02b5 (diff)
downloadgcc-18474649d91dd922555c5af509206a7aa3c65285.zip
gcc-18474649d91dd922555c5af509206a7aa3c65285.tar.gz
gcc-18474649d91dd922555c5af509206a7aa3c65285.tar.bz2
tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of vector type.
2011-10-05 Richard Guenther <rguenther@suse.de> * tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of vector type. (simplify_unary_expression): Handle BIT_FIELD_REFs. (try_to_simplify): Handle BIT_FIELD_REFs. From-SVN: r179549
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/tree-ssa-sccvn.c29
2 files changed, 31 insertions, 5 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 96cac67..d920a88 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+2011-10-05 Richard Guenther <rguenther@suse.de>
+
+ * tree-ssa-sccvn.c (vn_get_expr_for): Handle CONSTRUCTOR of
+ vector type.
+ (simplify_unary_expression): Handle BIT_FIELD_REFs.
+ (try_to_simplify): Handle BIT_FIELD_REFs.
+
2011-10-05 Georg-Johann Lay <avr@gjlay.de>
* config/avr/avr-protos.h (avr_out_addto_sp): New prototype.
diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c
index 208c272..4b5d388 100644
--- a/gcc/tree-ssa-sccvn.c
+++ b/gcc/tree-ssa-sccvn.c
@@ -275,6 +275,13 @@ vn_get_expr_for (tree name)
gimple_assign_rhs2 (def_stmt));
break;
+ case tcc_exceptional:
+ if (code == CONSTRUCTOR
+ && TREE_CODE
+ (TREE_TYPE (gimple_assign_rhs1 (def_stmt))) == VECTOR_TYPE)
+ expr = gimple_assign_rhs1 (def_stmt);
+ break;
+
default:;
}
if (expr == NULL_TREE)
@@ -2922,7 +2929,8 @@ simplify_unary_expression (gimple stmt)
GIMPLE_ASSIGN_SINGLE codes. */
if (code == REALPART_EXPR
|| code == IMAGPART_EXPR
- || code == VIEW_CONVERT_EXPR)
+ || code == VIEW_CONVERT_EXPR
+ || code == BIT_FIELD_REF)
op0 = TREE_OPERAND (op0, 0);
if (TREE_CODE (op0) != SSA_NAME)
@@ -2934,7 +2942,8 @@ simplify_unary_expression (gimple stmt)
else if (CONVERT_EXPR_CODE_P (code)
|| code == REALPART_EXPR
|| code == IMAGPART_EXPR
- || code == VIEW_CONVERT_EXPR)
+ || code == VIEW_CONVERT_EXPR
+ || code == BIT_FIELD_REF)
{
/* We want to do tree-combining on conversion-like expressions.
Make sure we feed only SSA_NAMEs or constants to fold though. */
@@ -2943,6 +2952,7 @@ simplify_unary_expression (gimple stmt)
|| BINARY_CLASS_P (tem)
|| TREE_CODE (tem) == VIEW_CONVERT_EXPR
|| TREE_CODE (tem) == SSA_NAME
+ || TREE_CODE (tem) == CONSTRUCTOR
|| is_gimple_min_invariant (tem))
op0 = tem;
}
@@ -2951,7 +2961,14 @@ simplify_unary_expression (gimple stmt)
if (op0 == orig_op0)
return NULL_TREE;
- result = fold_unary_ignore_overflow (code, gimple_expr_type (stmt), op0);
+ if (code == BIT_FIELD_REF)
+ {
+ tree rhs = gimple_assign_rhs1 (stmt);
+ result = fold_ternary (BIT_FIELD_REF, TREE_TYPE (rhs),
+ op0, TREE_OPERAND (rhs, 1), TREE_OPERAND (rhs, 2));
+ }
+ else
+ result = fold_unary_ignore_overflow (code, gimple_expr_type (stmt), op0);
if (result)
{
STRIP_USELESS_TYPE_CONVERSION (result);
@@ -2989,7 +3006,8 @@ try_to_simplify (gimple stmt)
/* Fallthrough for some unary codes that can operate on registers. */
if (!(code == REALPART_EXPR
|| code == IMAGPART_EXPR
- || code == VIEW_CONVERT_EXPR))
+ || code == VIEW_CONVERT_EXPR
+ || code == BIT_FIELD_REF))
break;
/* We could do a little more with unary ops, if they expand
into binary ops, but it's debatable whether it is worth it. */
@@ -3159,7 +3177,8 @@ visit_use (tree use)
/* VOP-less references can go through unary case. */
if ((code == REALPART_EXPR
|| code == IMAGPART_EXPR
- || code == VIEW_CONVERT_EXPR)
+ || code == VIEW_CONVERT_EXPR
+ || code == BIT_FIELD_REF)
&& TREE_CODE (TREE_OPERAND (rhs1, 0)) == SSA_NAME)
{
changed = visit_nary_op (lhs, stmt);