This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Re: COME ON! FIXIT! AGAIN: cvs bootstrap failure on hppa2.0w-hp-hpux11.00
- To: Markus Werle <markus at lufmech dot rwth-aachen dot de>
- Subject: [PATCH] Re: COME ON! FIXIT! AGAIN: cvs bootstrap failure on hppa2.0w-hp-hpux11.00
- From: Alan Modra <alan at linuxcare dot com dot au>
- Date: Tue, 23 Jan 2001 14:15:38 +1100 (EST)
- cc: gcc-bugs at gcc dot gnu dot org, gcc-patches at gcc dot gnu dot org, Jeffrey A Law <law at redhat dot com>
On Mon, 22 Jan 2001, Markus Werle wrote:
> details of a debugger run of xgcc:
>
> Signal received by process 14590: (SIGSEGV).
> Stopped at: `va(c0177a04) (C0177A04)
>
> C01779D0 `va(c01779d0) LDO 8(r25),r26
This sort of info from the debugger isn't a great deal of use. We really
need a back-trace to see where this is failing, which in this case is a
little difficult as cc1 has run away due to stack corruption. You need to
narrow down where the problem occurs by setting breakpoints to find how
far cc1 gets in it's initialisation.
That being said, I hit the same problem when trying to bootstrap with the
native C compiler. Here's the fix:
* config/pa/pa.c (hppa_encode_label): Correct size of alloca
buffer so we don't overrun it. Don't trim off leading `*'.
Jeff, please note that there are two fixes here. I'm not dead certain of
the `*' fix, but the code was nonsense as it stood.
stage2 bootstrap successfuly went past "make compare".
Patches applied:
- this one :-)
- Dave Anglin's EPILOGUE_USES patch. This fixes my incomplete
PIC_OFFSET_TABLE_REGNUM_SAVED patch, and without this patch gcc is in
violation of both the 64-bit and 32-bit ABI for PIC.
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg01397.html
- unimportant tidying in
http://gcc.gnu.org/ml/gcc-patches/2001-01/msg01645.html
Alan Modra
--
Linuxcare. Support for the Revolution.
*** egcs/gcc/config/pa/pa.c Mon Jan 22 00:28:20 2001
--- newegcs/gcc/config/pa/pa.c Tue Jan 23 13:07:50 2001
*************** hppa_encode_label (sym)
*** 5984,6001 ****
rtx sym;
{
const char *str = XSTR (sym, 0);
! int len = strlen (str);
! char *newstr = alloca (len + 1);
if (str[0] == '*')
! *newstr++ = *str++;
! strcpy (newstr + 1, str);
! *newstr = '@';
!
! /* Prepending '@' increases the length of the string. That's important
! to note since we're going to allocate persistent storage for the
! new string. */
! len++;
XSTR (sym,0) = ggc_alloc_string (newstr, len);
}
--- 5984,5997 ----
rtx sym;
{
const char *str = XSTR (sym, 0);
! int len = strlen (str) + 1;
! char *newstr, *p;
+ p = newstr = alloca (len + 1);
if (str[0] == '*')
! *p++ = *str++;
! *p++ = '@';
! strcpy (p, str);
XSTR (sym,0) = ggc_alloc_string (newstr, len);
}