This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Adjust STRIP_USELESS_TYPE_CONVERSION
- From: kenner at vlsi1 dot ultra dot nyu dot edu (Richard Kenner)
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 3 Jul 04 09:49:06 EDT
- Subject: Adjust STRIP_USELESS_TYPE_CONVERSION
It should reallty strip useless VIEW_CONVERT_EXPRs too and if it also does
NON_LVALUE_EXPR, we remove two sets of strips.
Tested on x86_64-linux-gnu.
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.
*** tree-ssa-ccp.c 29 Jun 2004 06:59:34 -0000 2.14
--- tree-ssa-ccp.c 2 Jul 2004 18:47:50 -0000
*************** fold_stmt (tree *stmt_p)
*** 2087,2091 ****
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);
--- 2087,2090 ----
*** tree-ssa-dom.c 2 Jul 2004 00:51:00 -0000 2.20
--- tree-ssa-dom.c 2 Jul 2004 18:47:52 -0000
*************** local_fold (tree t)
*** 280,284 ****
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);
--- 280,283 ----
*** tree-ssa.c 30 Jun 2004 21:28:59 -0000 2.17
--- tree-ssa.c 2 Jul 2004 18:47:56 -0000
*************** tree_ssa_useless_type_conversion (tree e
*** 602,606 ****
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)
return tree_ssa_useless_type_conversion_1 (TREE_TYPE (expr),
TREE_TYPE (TREE_OPERAND (expr,
--- 602,608 ----
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
! || 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,