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]
Other format: [Raw text]

Re: Help with gmp-4.0.1 and gcc-3.3.1 on sparcv9?


On Wed, Oct 01, 2003 at 05:17:50PM -0500, Bradley Lucier wrote:
> I thought I'd try the tree-ssa branch on my typical Scheme code.  It's 
> been an interesting journey ...
> 
> I got the C compiler built on sparc-sun-solaris2.8, but it ran into the 
> 2GB process limit compiling most of my files so I'm trying to build the 
> 64-bit version for sparcv9.  I'm backing off to just the C compiler 
> since I'm having trouble compiling gmp-4.0.1 with gcc-3.3.1.  I've 
> searched the gcc web pages but couldn't find a reference to this 
> problem.
> 
> After a generic configure of gmp-4.0.1, the build fails with
> 
> gcc -DHAVE_CONFIG_H -I. -I. -I.. -D__GMP_WITHIN_GMP -I.. 
> -DOPERATION_divrem_1 -g -O2 -m64 -mptr64 -Wa,-xarch=v9 -mcpu=v9 -c 
> divrem_1.c  -fPIC -DPIC -o .libs/divrem_1.o
> divrem_1.c: In function `__gmpn_divrem_1':
> divrem_1.c:159: warning: right shift count >= width of type
> divrem_1.c:239: warning: right shift count >= width of type
> /usr/ccs/bin/as: "/tmp/ccTJHvaN.s", line 655: error: statement syntax
> /usr/ccs/bin/as: "/tmp/ccTJHvaN.s", line 656: error: statement syntax
> /usr/ccs/bin/as: "/tmp/ccTJHvaN.s", line 1072: error: statement syntax
> /usr/ccs/bin/as: "/tmp/ccTJHvaN.s", line 1073: error: statement syntax
> make[2]: *** [divrem_1.lo] Error 1
> make[2]: Leaving directory 
> `/export/mdd0/users/lucier/programs/gcc/gcc-ssa/gmp-4.0.1/mpn'
> 
> The offending lines are (655 & 656):
> 
> 	subcc	0,%g4,%l5
> 	subccc	0,%g1,%g0
> 
> and (1072 & 1073)
> 
> 	subcc	0,%g4,%g5
> 	subccc	0,%g1,%g0
> 
> Any suggestions?  (Like back off to gmp-3.*?)

Looks to be gmp bug:
__asm__ ("subcc %4,%5,%1\n"
	 "   subccc  %6,%7,%%g0\n"
	 " subc    %2,%3,%0"
	 : "=r" (_xh), "=&r" (_r)
	 : "%rJ" ((r)), "rI" (_xh), "%rJ" ((n0)), "rI" (_xl), "rJ" (((n0)) >> 32), "rJ" ((_xl) >> 32)
	 : "cc");
Obviously, the %2 is not commutative with %3 and neither is %4 with %5.
Just s/"%r/"r/g should fix it.

	Jakub


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