This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tree-ssa]: Recent stmt_ann checking breaks SSAPRE
- From: Daniel Berlin <dberlin at dberlin dot org>
- To: Diego Novillo <dnovillo at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 1 Jul 2003 15:43:41 -0400
- Subject: [tree-ssa]: Recent stmt_ann checking breaks SSAPRE
We put stmt annotations on E*_NODE's, because they always represent
statements, and thus, set_bb_for_stmt and bb_for_stmt makes sense on
them.
We don't use any of the *other* members of stmt_ann, but i'd rather
just not make up a new interface that does the same thing, just to
track their bb's.
They aren't GIMPLE stmts, however, so i'm not going to modify
is_gimple_stmt.
So i'd like to install the following patch, okay?
PS I've successfully bootstrapped with SSAPRE on on powerpc-darwin
(ignoring mudflap), and x86 (all languages but ADA). Could you give it
a try on ia64 or some weirder platform while i work through regression
tests?
2003-07-01 Daniel Berlin <dberlin@dberlin.org>
* tree-flow-inline.h (stmt_ann): We have stmt_ann on E*_NODE's as
well,
so use is_essa_node as well.
* tree.h (is_essa_node): Declare.
* tree.c (is_essa_node): Define.
Index: tree.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.c,v
retrieving revision 1.263.2.38
diff -u -3 -p -r1.263.2.38 tree.c
--- tree.c 1 Jul 2003 04:04:32 -0000 1.263.2.38
+++ tree.c 1 Jul 2003 19:38:26 -0000
@@ -5376,6 +5377,16 @@ body_is_empty (t)
return false;
return true;
+}
+bool
+is_essa_node (t)
+ tree t;
+{
+ if (TREE_CODE (t) == ELEFT_NODE || TREE_CODE (t) == EPHI_NODE
+ || TREE_CODE (t) == EUSE_NODE || TREE_CODE (t) == EEXIT_NODE
+ || TREE_CODE (t) == EKILL_NODE)
+ return true;
+ return false;
}
#include "gt-tree.h"
Index: tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/tree.h,v
retrieving revision 1.342.2.72
diff -u -3 -p -r1.342.2.72 tree.h
--- tree.h 1 Jul 2003 04:04:32 -0000 1.342.2.72
+++ tree.h 1 Jul 2003 19:38:27 -0000
@@ -2991,6 +2998,7 @@ extern tree get_callee_fndecl
extern void set_decl_assembler_name PARAMS ((tree));
extern int type_num_arguments PARAMS ((tree));
extern tree lhd_unsave_expr_now PARAMS ((tree));
+extern bool is_essa_node PARAMS ((tree));
/* In stmt.c */
Index: tree-flow-inline.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Attic/tree-flow-inline.h,v
retrieving revision 1.1.2.38
diff -u -3 -p -r1.1.2.38 tree-flow-inline.h
--- tree-flow-inline.h 1 Jul 2003 04:04:31 -0000 1.1.2.38
+++ tree-flow-inline.h 1 Jul 2003 19:38:27 -0000
@@ -52,7 +52,7 @@ stmt_ann (t)
tree t;
{
#if defined ENABLE_CHECKING
- if (!is_gimple_stmt (t))
+ if (!is_gimple_stmt (t) && !is_essa_node (t))
abort ();
#endif