This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++ PATCH]: size_zero_node
- To: gcc-patches at gcc dot gnu dot org
- Subject: [C++ PATCH]: size_zero_node
- From: Nathan Sidwell <nathan at codesourcery dot com>
- Date: Thu, 16 Mar 2000 09:38:14 +0000
- Organization: CodeSourcery, LLC
[oops, fluffed the gcc address]
Hi,
G++ had been assuming that all incomplete types had either NULL or
size_zero_node TYPE_SIZE. This is no longer true.
Mon Mar 6 15:22:29 2000 Richard Kenner <kenner@vlsi1.ultra.nyu.edu>
* stor-layout.c
(layout_type, case VOID_TYPE): TYPE_SIZE must be bitsizetype.
It causes a check of a checking build to produce these
Internal compiler error in `expand_throw', at ../egcs-20000313/gcc/cp/except.c:949
Tree check: expected class 't', have 'x' (error_mark)
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-3.C:14
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-4.C:12
gcc/testsuite/g++.old-deja/g++.robertl/ice990323-5.C:11
Here's a patch which stops G++ making that assumption. Ok? Or would
it be better to restore the use of size_zero_node?
nathan
--
Dr Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC
'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
2000-03-16 Nathan Sidwell <nathan@codesourcery.com>
* typeck.c (require_complete_type): Don't assume size_zero_node.
(complete_type_or_else): Likewise.
Index: cp/typeck.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/cp/typeck.c,v
retrieving revision 1.263
diff -c -3 -p -r1.263 typeck.c
*** typeck.c 2000/03/15 09:45:39 1.263
--- typeck.c 2000/03/16 09:08:11
*************** require_complete_type (value)
*** 106,113 ****
type = TREE_TYPE (value);
/* First, detect a valid value with a complete type. */
! if (TYPE_SIZE (type) != 0
! && TYPE_SIZE (type) != size_zero_node)
return value;
/* If we see X::Y, we build an OFFSET_TYPE which has
--- 106,112 ----
type = TREE_TYPE (value);
/* First, detect a valid value with a complete type. */
! if (TYPE_SIZE (type) && !integer_zerop (TYPE_SIZE (type)))
return value;
/* If we see X::Y, we build an OFFSET_TYPE which has
*************** complete_type_or_else (type, value)
*** 177,183 ****
if (type == error_mark_node)
/* We already issued an error. */
return NULL_TREE;
! else if (!TYPE_SIZE (type) || TYPE_SIZE (type) == size_zero_node)
{
incomplete_type_error (value, type);
return NULL_TREE;
--- 176,182 ----
if (type == error_mark_node)
/* We already issued an error. */
return NULL_TREE;
! else if (!TYPE_SIZE (type) || integer_zerop (TYPE_SIZE (type)))
{
incomplete_type_error (value, type);
return NULL_TREE;