This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: The current egcs is broken on x86
- To: wilson at cygnus dot com (Jim Wilson)
- Subject: Re: The current egcs is broken on x86
- From: hjl at lucon dot org (H.J. Lu)
- Date: Sat, 13 Jun 1998 09:27:21 -0700 (PDT)
- Cc: meissner at cygnus dot com, egcs at cygnus dot com
>
> My patched rebuild failed in stage2 while running the stage2 compiler to
> build the SYSCALLS.c file. I suspect another bug in the recent regmove
> changes.
>
Jim, Mike, c-lex.c is miscompiled by regmove.c change. Here is a small
test case. Here is the asm diff compield by -O2 -S:
--- b.s Sat Jun 13 09:23:48 1998
+++ ../gcc/b.s Sat Jun 13 09:23:52 1998
@@ -50,6 +50,7 @@
testl %eax,%eax
jne .L5
movl token_buffer,%ebx
+ movl -28(%ebp),%eax
subl %ebx,%eax
leal 1(%eax),%ecx
addl $4,%eax
As you can see, %eax is clobbered but not restored. I hope it should
have enough info to fix it.
Thanks.
--
H.J. Lu (hjl@gnu.org)
-----b.c---
#include <stdio.h>
FILE *finput;
#define GETC() getc (finput)
#define UNGETC(c) ungetc (c, finput)
char *extend_token_buffer (char *);
static int maxtoken;
char *token_buffer;
int
yylex ()
{
register int c;
register char *p;
{
p = token_buffer;
*p++ = c;
if (c == '.'
|| (c != 'l' && c != 'L'
&& c != 'u' && c != 'U'
&& c != 'i' && c != 'I' && c != 'j' && c != 'J'))
*--p = 0;
{
int imag = 0;
char handler [20];
*p = 0;
if (setjmp (handler))
{
imag = 1;
}
else
{
int fflag = 0, lflag = 0;
char *copy = (char *) alloca (p - token_buffer + 1);
bcopy (token_buffer, copy, p - token_buffer + 1);
while (1)
{
int lose = 0;
switch (c)
{
case 'f': case 'F':
fflag = 1;
break;
default:
lose = 1;
}
if (lose)
break;
*p++ = c;
*p = 0;
c = GETC();
}
}
}
}
}