This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa] Don't handle INIT_EXPR in GIMPLE form [patch]
- From: Diego Novillo <dnovillo at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 27 Feb 2003 23:38:36 -0500
- Subject: [tree-ssa] Don't handle INIT_EXPR in GIMPLE form [patch]
- Organization: Red Hat Canada
Jason confirmed today that INIT_EXPR nodes are eliminated by the
gimplification pass.
Bootstrapped and tested on x86.
Diego.
* tree-dfa.c (get_stmt_operands): INIT_EXPR nodes cannot
appear in GIMPLE form. Don't handle them.
(get_expr_operands): Likewise.
(find_vars_r): Likewise.
* tree-ssa-ccp.c (get_rhs): Likewise.
(set_rhs): Likewise.
* tree-ssa-pre.c (tree_perform_ssapre): Likewise.
Index: tree-dfa.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-dfa.c,v
retrieving revision 1.1.4.82
diff -d -u -p -r1.1.4.82 tree-dfa.c
--- tree-dfa.c 26 Feb 2003 16:26:03 -0000 1.1.4.82
+++ tree-dfa.c 27 Feb 2003 23:07:37 -0000
@@ -195,7 +195,6 @@ get_stmt_operands (stmt)
code = TREE_CODE (stmt);
switch (code)
{
- case INIT_EXPR:
case MODIFY_EXPR:
get_expr_operands (stmt, &TREE_OPERAND (stmt, 1), false, prev_vops);
get_expr_operands (stmt, &TREE_OPERAND (stmt, 0), true, prev_vops);
@@ -438,7 +437,7 @@ get_expr_operands (stmt, expr_p, is_def,
}
/* Assignments. */
- if (code == INIT_EXPR || code == MODIFY_EXPR)
+ if (code == MODIFY_EXPR)
{
get_expr_operands (stmt, &TREE_OPERAND (expr, 1), false, prev_vops);
get_expr_operands (stmt, &TREE_OPERAND (expr, 0), true, prev_vops);
@@ -2103,7 +2102,7 @@ find_vars_r (tp, walk_subtrees, data)
struct walk_state *walk_state = (struct walk_state *)data;
int saved_is_store = walk_state->is_store;
- if (TREE_CODE (t) == MODIFY_EXPR || TREE_CODE (t) == INIT_EXPR)
+ if (TREE_CODE (t) == MODIFY_EXPR)
{
walk_state->is_store = 1;
walk_tree (&TREE_OPERAND (t, 0), find_vars_r, data, NULL);
Index: tree-ssa-ccp.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-ccp.c,v
retrieving revision 1.1.2.61
diff -d -u -p -r1.1.2.61 tree-ssa-ccp.c
--- tree-ssa-ccp.c 27 Feb 2003 20:08:00 -0000 1.1.2.61
+++ tree-ssa-ccp.c 27 Feb 2003 23:07:38 -0000
@@ -1196,7 +1196,7 @@ get_rhs (stmt)
{
enum tree_code code = TREE_CODE (stmt);
- if (code == MODIFY_EXPR || code == INIT_EXPR)
+ if (code == MODIFY_EXPR)
return TREE_OPERAND (stmt, 1);
if (code == COND_EXPR)
return COND_EXPR_COND (stmt);
@@ -1222,7 +1222,7 @@ set_rhs (stmt, expr)
{
enum tree_code code = TREE_CODE (stmt);
- if (code == MODIFY_EXPR || code == INIT_EXPR)
+ if (code == MODIFY_EXPR)
TREE_OPERAND (stmt, 1) = expr;
if (code == COND_EXPR)
COND_EXPR_COND (stmt) = expr;
Index: tree-ssa-pre.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-ssa-pre.c,v
retrieving revision 1.1.4.48
diff -d -u -p -r1.1.4.48 tree-ssa-pre.c
--- tree-ssa-pre.c 13 Feb 2003 17:30:25 -0000 1.1.4.48
+++ tree-ssa-pre.c 27 Feb 2003 23:07:38 -0000
@@ -2855,8 +2855,7 @@ tree_perform_ssapre (fndecl)
tree stmt = bsi_stmt (j);
struct expr_info *slot = NULL;
- if (TREE_CODE (expr) == MODIFY_EXPR
- || TREE_CODE (expr) == INIT_EXPR)
+ if (TREE_CODE (expr) == MODIFY_EXPR)
expr = TREE_OPERAND (expr, 1);
if (TREE_CODE_CLASS (TREE_CODE (expr)) == '2')
{