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: The current egcs is broken on x86


> 
> 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();
		  }
	    }
	}
    }
}


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