This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: ICE980331 *2 with egcs-2.91.47 19980710
- To: Franz dot Sirl-kernel at lauterbach dot com
- Subject: Re: ICE980331 *2 with egcs-2.91.47 19980710
- From: Martin von Loewis <martin at mira dot isdn dot cs dot tu-berlin dot de>
- Date: Sat, 11 Jul 1998 10:37:55 +0200
- CC: egcs-bugs at cygnus dot com, egcs-patches at cygnus dot com, law at cygnus dot com
- References: <98071023125101.05347@ns1102.munich.netsurf.de>
> I've put 2 more cases of "internal compiler error 980331" on
> http://homepages.munich.netsurf.de/Franz.Sirl/misc
>
> They are named htmlview.ii and FOTBuilder.ii. You have to compile
> with -O2 to see the bug.
Thanks for the report. I could reproduce it on i486-pc-linux-gnu,
which is rather lucky as it is an off-by-one error in some only
remotely related code.
The patch below fixes it for me.
Jeff, isn't the bitfield at offset 2??? Also, I could rewrite this
as using push_obstacks/pop_obstacks.
Regards,
Martin
1998-07-11 Martin von Löwis <loewis@informatik.hu-berlin.de>
* search.c (my_tree_cons): The bitfield is at index 2.
Index: search.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/search.c,v
retrieving revision 1.36
diff -c -p -r1.36 search.c
*** search.c 1998/06/13 23:34:55 1.36
--- search.c 1998/07/11 08:25:32
*************** my_tree_cons (purpose, value, chain)
*** 266,272 ****
/* The type of the last on the LHS of this statement must be a pointer
to the same type as the bitfields in struct tree_common. Otherwise
we may write beyond our intended area. */
! ((unsigned *)p)[3] = 0;
TREE_SET_CODE (p, TREE_LIST);
TREE_PURPOSE (p) = purpose;
TREE_VALUE (p) = value;
--- 266,272 ----
/* The type of the last on the LHS of this statement must be a pointer
to the same type as the bitfields in struct tree_common. Otherwise
we may write beyond our intended area. */
! ((unsigned *)p)[2] = 0;
TREE_SET_CODE (p, TREE_LIST);
TREE_PURPOSE (p) = purpose;
TREE_VALUE (p) = value;