This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
some small fixes for tree type-check failures
- To: egcs-patches at egcs dot cygnus dot com
- Subject: some small fixes for tree type-check failures
- From: Zack Weinberg <zack at bitmover dot com>
- Date: Wed, 25 Aug 1999 14:29:08 -0700
There are a bunch more in the present code but I am not qualified to
fix them.
zw
1999-08-25 14:27 -0700 Zack Weinberg <zack@bitmover.com>
* c-decl.c (pushdecl): Do not examine fields of an ERROR_MARK
node.
* c-typeck.c (c_expand_start_case): Likewise.
* fold-const.c (operand_equal_p): Likewise.
* stor-layout.c (layout_type): Likewise.
===================================================================
Index: c-decl.c
--- c-decl.c 1999/08/09 13:59:41 1.67
+++ c-decl.c 1999/08/25 21:19:06
@@ -2477,8 +2477,9 @@ pushdecl (x)
b->shadowed = tree_cons (name, oldlocal, b->shadowed);
}
- /* Keep count of variables in this level with incomplete type. */
- if (TYPE_SIZE (TREE_TYPE (x)) == 0)
+ /* Keep count of variables in this level with incomplete type.
+ A completely erroneous type is not an incomplete type. */
+ if (TREE_TYPE (x) != error_mark_node && TYPE_SIZE (TREE_TYPE (x)) == 0)
++b->n_incomplete;
}
===================================================================
Index: c-typeck.c
--- c-typeck.c 1999/08/03 00:58:44 1.33
+++ c-typeck.c 1999/08/25 21:19:07
@@ -6706,8 +6706,14 @@ tree
c_expand_start_case (exp)
tree exp;
{
- register enum tree_code code = TREE_CODE (TREE_TYPE (exp));
- tree type = TREE_TYPE (exp);
+ register enum tree_code code;
+ tree type;
+
+ if (TREE_CODE (exp) == ERROR_MARK)
+ return exp;
+
+ code = TREE_CODE (TREE_TYPE (exp));
+ type = TREE_TYPE (exp);
if (code != INTEGER_TYPE && code != ENUMERAL_TYPE && code != ERROR_MARK)
{
===================================================================
Index: fold-const.c
--- fold-const.c 1999/08/24 22:37:34 1.68
+++ fold-const.c 1999/08/25 21:19:12
@@ -2091,6 +2091,8 @@ operand_equal_p (arg0, arg1, only_const)
if (TREE_CODE (arg0) != TREE_CODE (arg1)
/* This is needed for conversions and for COMPONENT_REF.
Might as well play it safe and always test this. */
+ || TREE_CODE (TREE_TYPE (arg0)) == ERROR_MARK
+ || TREE_CODE (TREE_TYPE (arg1)) == ERROR_MARK
|| TYPE_MODE (TREE_TYPE (arg0)) != TYPE_MODE (TREE_TYPE (arg1)))
return 0;
===================================================================
Index: stor-layout.c
--- stor-layout.c 1999/08/15 20:08:12 1.28
+++ stor-layout.c 1999/08/25 21:19:18
@@ -936,7 +936,8 @@ layout_type (type)
{
int bitpos;
- if (TREE_CODE (field) != FIELD_DECL)
+ if (TREE_CODE (field) != FIELD_DECL
+ || TREE_CODE (TREE_TYPE (field)) == ERROR_MARK)
continue;
if (TYPE_MODE (TREE_TYPE (field)) == BLKmode