This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[C++] fix a latent bug in cp-tree.h
- From: Steven Bosscher <stevenb at suse dot de>
- To: gcc-patches at gcc dot gnu dot org, geoffk at apple dot com
- Date: Thu, 27 May 2004 14:29:46 +0200 (CEST)
- Subject: [C++] fix a latent bug in cp-tree.h
- Organization: SuSE Linux AG
Hi,
While working on switch lowering for trees, I got a bootstrap error because
in one of the c++ gt headers, a switch label was out of range of the switch's
controlling expression. This turned out to be a switch with three case labels
on a single-bit bitfield, is_lang_type_class in struct lang_type_header.
The attached patch should fix that. Is it safe to use GTY((skip(""))) in a
union like this? Bootstapping/testing on amd64 seems to think so, but
I'd like to be sure and hear from the experts :)
Gr.
Steven
Index: cp/cp-tree.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cp-tree.h,v
retrieving revision 1.968
diff -c -3 -p -r1.968 cp-tree.h
*** cp/cp-tree.h 20 May 2004 11:36:14 -0000 1.968
--- cp/cp-tree.h 27 May 2004 12:20:51 -0000
*************** struct lang_type GTY(())
*** 1091,1097 ****
{
union lang_type_u
{
! struct lang_type_header GTY((tag ("2"))) h;
struct lang_type_class GTY((tag ("1"))) c;
struct lang_type_ptrmem GTY((tag ("0"))) ptrmem;
} GTY((desc ("%h.h.is_lang_type_class"))) u;
--- 1091,1097 ----
{
union lang_type_u
{
! struct lang_type_header GTY((skip (""))) h;
struct lang_type_class GTY((tag ("1"))) c;
struct lang_type_ptrmem GTY((tag ("0"))) ptrmem;
} GTY((desc ("%h.h.is_lang_type_class"))) u;