Subject: Re: Using current gcc & binutils and NetBSD -current speeds
To: Ian Dall <ian@beware.dropbear.id.au>
From: Simon Burge <simonb@wasabisystems.com>
List: port-pc532
Date: 12/06/2002 16:00:28
Ian Dall wrote:

> Simon Burge <simonb@wasabisystems.com> writes:
> 
> > Hi folks (and inparticular Ian(!)),
> > 
> > I have managed to build a kernel with current gcc and binutils.  Most
> > files built with -O2, but I needed a build a couple with -O1 to avoid
> > 
> > 	internal compiler error: in general_operand, at recog.c:1023
> > 
> > type errors.
> 
> Try the following gcc fix:
> 
> diff -u -r1.6 ns32k.h
> --- ns32k.h     1 Dec 2002 06:27:52 -0000       1.6
> +++ ns32k.h     1 Dec 2002 13:29:53 -0000
> @@ -1058,7 +1058,6 @@
>    else if (GET_CODE (xfooy) == PRE_DEC)                                       \
>      {                                                                  \
>        if (REGNO (XEXP (xfooy, 0)) == STACK_POINTER_REGNUM) goto ADDR;  \
> -      else abort ();                                                   \
>      }                                                                  \
>  }

With this, I get all the way through building a kernel with -O2.

And with this change:

	Index: cpufunc.h
	===================================================================
	RCS file: /cvsroot/syssrc/sys/arch/pc532/include/cpufunc.h,v
	retrieving revision 1.4
	diff -d -p -u -r1.4 cpufunc.h
	--- cpufunc.h   1997/04/21 16:16:31     1.4
	+++ cpufunc.h   2002/12/06 04:28:47
	@@ -83,9 +83,9 @@
		register void *r1 __asm("r1") = from; \
		register void *r2 __asm("r2") = to; \
		__asm __volatile ("movs" type \
	-               : "=r" (r1), "=r" (r2) \
	-               : "0" (r1), "1" (r2), "r" (r0) \
	-               : "r0", "memory" \
	+               : "+r" (r0), "+r" (r1), "+r" (r2) \
	+               : \
	+               : "memory" \
		);
	 #define movs_update(type, from, to, n) do { \
			movs(type, from, to, n); \

my "fatal abort trap in supervisor mode" problem is gone.  So I'm now
running a gcc 3.3(ish) compiled kernel on my 532, compiled in only about
2 minutes on my server PC!

Everyone happy with that patch?  ncr.c and pmap.c compile with the old
toolchain but I haven't yet waited the other 4 hours for a native
compile to finish...

Simon.
--
Simon Burge                            <simonb@wasabisystems.com>
NetBSD Support and Service:         http://www.wasabisystems.com/