This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Successful fixincludes on i686-pc-linux-gnu (but not on m68k-next-nextstep3)


On Sun, Feb 13, 2000 at 02:28:15PM -0500, Kaveh R. Ghazi wrote:
>  > From: Toon Moene <toon@moene.indiv.nluug.nl>
>  > 
>  > Yesterday I wrote:
>  > 
>  > > Well, it seems to work - next item on the work list is to check the same
>  > > on the m68k-next-nextstep3 machine upstairs ...
>  > 
>  > Here I was less lucky.  CPP bombs on the very first file it has to
>  > preprocess, tmp-dum.c:
>  > 
>  > int xxy_us_dummy;
>  > 
>  > with an segmentation fault on line 151 of cpphash.c
>  > 
>  > 151	for (ap = d->pattern; ap != NULL; ap = nextap)
>  > 
>  > (gdb) p d
>  > $1 = (struct definition *) 0x0
>  > 
>  > [ It might of course be that we're simply looking at a cpp miscompiled 
>  >   by the stage1 compiler - sigh ]
>  > 
>  > Hope this helps,
> 
> 
> I don't think it is the stage1 compiler.  I am getting the same
> symptom on sunos4.  However it happens when running
> fixproto/fix-header.  (Fix-header is linked with libcpp.a.)
> 
> Here is the backtrace:
> 
> (gdb) where
> #0  0x105a8 in free_definition (d=0x0)
>     at ../../egcs-CVS20000212/gcc/cpphash.c:151
> #1  0x88f4 in do_define (pfile=0xefffe8ec, keyword=0x0)
>     at ../../egcs-CVS20000212/gcc/cpplib.c:719
> #2  0x6ff8 in cpp_define (pfile=0xefffe8ec, str=0xefffee3d
> "__STDC__=0")

Argh.  Please try this patch.

zw

===================================================================
Index: cpplib.c
--- cpplib.c	2000/02/11 20:17:27	1.114
+++ cpplib.c	2000/02/13 19:34:15
@@ -715,8 +715,9 @@ do_define (pfile, keyword)
       if (hp->type != T_POISON)
 	{
 	  /* Replace the old definition.  */
+	  if (hp->type == T_MACRO)
+	    free_definition (hp->value.defn);
 	  hp->type = T_MACRO;
-	  free_definition (hp->value.defn);
 	  hp->value.defn = mdef.defn;
 	}
     }

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]