This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[tuples] misc changes to bootstrap
- From: Aldy Hernandez <aldyh at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org, dnovillo at redhat dot com
- Date: Mon, 9 Oct 2006 09:23:50 -0400
- Subject: [tuples] misc changes to bootstrap
TREE_{CHAIN,TYPE} needed "__extension__" when bootstrapping. There is also a small
typo in tree-mudflap wrt a missing parentheses. I should get around to fixing it on
mainline as well.
With these changes we can now bootstrap the compiler (C only). Yay!
Committed.
* tree.h (TREE_CHAIN, TREE_TYPE): Add versions for non GCC or not enable checking.
Also, add __extension__ to GCC versions.
* tree-mudflap.c (mf_xform_derefs_1): Add parentheses around TREE_TYPE.
* tree-inline.c (copy_tree_r): Initialize chain to assuage the warning patrol.
Index: tree.h
===================================================================
--- tree.h (revision 117466)
+++ tree.h (working copy)
@@ -815,6 +815,31 @@ enum tree_node_structure_enum {
__FILE__, __LINE__, __FUNCTION__); \
&__t->exp.operands[__i]; }))
+/* Nodes are chained together for many purposes.
+ Types are chained together to record them for being output to the debugger
+ (see the function `chain_type').
+ Decls in the same scope are chained together to record the contents
+ of the scope.
+ Statement nodes for successive statements used to be chained together.
+ Often lists of things are represented by TREE_LIST nodes that
+ are chained together. */
+
+#define TREE_CHAIN(NODE) __extension__ \
+(*({const tree __t = (NODE); \
+ if (GIMPLE_TUPLE_P (__t)) \
+ gcc_unreachable (); \
+ &__t->common.chain; }))
+
+/* In all nodes that are expressions, this is the data type of the expression.
+ In POINTER_TYPE nodes, this is the type that the pointer points to.
+ In ARRAY_TYPE nodes, this is the type of the elements.
+ In VECTOR_TYPE nodes, this is the type of the elements. */
+#define TREE_TYPE(NODE) __extension__ \
+(*({const tree __t = (NODE); \
+ if (GIMPLE_TUPLE_P (__t)) \
+ gcc_unreachable (); \
+ &__t->common.type; }))
+
extern void tree_contains_struct_check_failed (const tree,
const enum tree_node_structure_enum,
const char *, int, const char *)
@@ -882,6 +907,9 @@ extern void omp_clause_range_check_faile
#define OMP_CLAUSE_RANGE_CHECK(T, CODE1, CODE2) (T)
#define OMP_CLAUSE_SUBCODE_CHECK(T, CODE) (T)
+#define TREE_CHAIN(NODE) ((NODE)->common.chain)
+#define TREE_TYPE(NODE) ((NODE)->common.type)
+
#endif
#define TREE_BLOCK(NODE) *(tree_block (NODE))
@@ -929,16 +957,6 @@ extern void omp_clause_range_check_faile
#define PROTECTED_TREE_TYPE(NODE) *(protected_tree_type ((NODE)))
-/* In all nodes that are expressions, this is the data type of the expression.
- In POINTER_TYPE nodes, this is the type that the pointer points to.
- In ARRAY_TYPE nodes, this is the type of the elements.
- In VECTOR_TYPE nodes, this is the type of the elements. */
-#define TREE_TYPE(NODE) \
-(*({ const tree __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
- &__t->common.type; }))
-
/* Here is how primitive or already-canonicalized types' hash codes
are made. */
#define TYPE_HASH(TYPE) (TYPE_UID (TYPE))
@@ -947,21 +965,6 @@ extern void omp_clause_range_check_faile
used in hash tables which are saved to a PCH. */
#define TREE_HASH(NODE) ((size_t) (NODE) & 0777777)
-/* Nodes are chained together for many purposes.
- Types are chained together to record them for being output to the debugger
- (see the function `chain_type').
- Decls in the same scope are chained together to record the contents
- of the scope.
- Statement nodes for successive statements used to be chained together.
- Often lists of things are represented by TREE_LIST nodes that
- are chained together. */
-
-#define TREE_CHAIN(NODE) \
-(*({ const tree __t = (NODE); \
- if (GIMPLE_TUPLE_P (__t)) \
- gcc_unreachable (); \
- &__t->common.chain; }))
-
/* Given an expression as a tree, strip any NON_LVALUE_EXPRs and NOP_EXPRs
that don't change the machine mode. */
Index: tree-mudflap.c
===================================================================
--- tree-mudflap.c (revision 117278)
+++ tree-mudflap.c (working copy)
@@ -819,7 +819,8 @@ mf_xform_derefs_1 (block_stmt_iterator *
size = DECL_SIZE_UNIT (field);
if (elt)
- elt = build1 (ADDR_EXPR, build_pointer_type TREE_TYPE (elt), elt);
+ elt = build1 (ADDR_EXPR, build_pointer_type (TREE_TYPE (elt)),
+ elt);
addr = fold_convert (ptr_type_node, elt ? elt : base);
addr = fold_build2 (PLUS_EXPR, ptr_type_node,
addr, fold_convert (ptr_type_node,
Index: tree-inline.c
===================================================================
--- tree-inline.c (revision 117284)
+++ tree-inline.c (working copy)
@@ -2321,7 +2321,7 @@ copy_tree_r (tree *tp, int *walk_subtree
{
/* Because the chain gets clobbered when we make a copy, we save it
here. */
- tree chain, new;
+ tree chain = NULL_TREE, new;
if (!GIMPLE_TUPLE_P (*tp))
chain = TREE_CHAIN (*tp);