summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-03 13:45:29 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>2004-07-03 13:45:29 +0000
commitb6b93727255b59e19fac1ccee91bb6cd377c21cc (patch)
tree34f13484cf58f62d24730cc46761b0c4d20b7ad2
parent8c3216aef96b99f911d02b76caee0faf6e4ba2d6 (diff)
downloadppe42-gcc-b6b93727255b59e19fac1ccee91bb6cd377c21cc.tar.gz
ppe42-gcc-b6b93727255b59e19fac1ccee91bb6cd377c21cc.zip
* tree-ssa.c (tree_ssa_useless_type_conversion): Also look at
VIEW_CONVERT_EXPR and NON_LVALUE_EXPR. * tree-ssa-ccp.c (fold_stmt): Call just STRIP_USELESS_TYPE_CONVERSION. * tree-ssa-dom.c (local_fold): Likewise. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@84054 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/tree-ssa-ccp.c1
-rw-r--r--gcc/tree-ssa-dom.c1
-rw-r--r--gcc/tree-ssa.c4
4 files changed, 8 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7a161eb5371..53722270cc7 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2004-07-03 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
+ * tree-ssa.c (tree_ssa_useless_type_conversion): Also look at
+ VIEW_CONVERT_EXPR and NON_LVALUE_EXPR.
+ * tree-ssa-ccp.c (fold_stmt): Call just STRIP_USELESS_TYPE_CONVERSION.
+ * tree-ssa-dom.c (local_fold): Likewise.
+
* langhooks-def.h (LANG_HOOKS_TYPE_MAX_SIZE): New langhook.
* langhooks.h (strct lang_hooks): New field type_max_size.
* function.c (assign_temp): Call it.
diff --git a/gcc/tree-ssa-ccp.c b/gcc/tree-ssa-ccp.c
index 559f19b0765..0b990717b33 100644
--- a/gcc/tree-ssa-ccp.c
+++ b/gcc/tree-ssa-ccp.c
@@ -2086,7 +2086,6 @@ fold_stmt (tree *stmt_p)
/* Strip away useless type conversions. Both the NON_LVALUE_EXPR that
may have been added by fold, and "useless" type conversions that might
now be apparent due to propagation. */
- STRIP_MAIN_TYPE_NOPS (result);
STRIP_USELESS_TYPE_CONVERSION (result);
if (result != rhs)
diff --git a/gcc/tree-ssa-dom.c b/gcc/tree-ssa-dom.c
index 49759978326..b556b4eedf2 100644
--- a/gcc/tree-ssa-dom.c
+++ b/gcc/tree-ssa-dom.c
@@ -279,7 +279,6 @@ local_fold (tree t)
/* Strip away useless type conversions. Both the NON_LVALUE_EXPR that
may have been added by fold, and "useless" type conversions that might
now be apparent due to propagation. */
- STRIP_MAIN_TYPE_NOPS (t);
STRIP_USELESS_TYPE_CONVERSION (t);
return t;
diff --git a/gcc/tree-ssa.c b/gcc/tree-ssa.c
index 37b83bfeca5..4cdfd3ddf22 100644
--- a/gcc/tree-ssa.c
+++ b/gcc/tree-ssa.c
@@ -601,7 +601,9 @@ tree_ssa_useless_type_conversion (tree expr)
the top of the RHS to the type of the LHS and the type conversion
is "safe", then strip away the type conversion so that we can
enter LHS = RHS into the const_and_copies table. */
- if (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR)
+ if (TREE_CODE (expr) == NOP_EXPR || TREE_CODE (expr) == CONVERT_EXPR
+ || TREE_CODE (expr) == VIEW_CONVERT_EXPR
+ || TREE_CODE (expr) == NON_LVALUE_EXPR)
return tree_ssa_useless_type_conversion_1 (TREE_TYPE (expr),
TREE_TYPE (TREE_OPERAND (expr,
0)));
OpenPOWER on IntegriCloud