Compile the attached file z.i with -O -fcall-used-g6 -save-temps, and you should see z.s:174: Error: Illegal operands: There are only 32 single precision f registers; [0-31] Here are lines 172 to 180 of the resulting z.s, not sure which line it's complaining about (gas seems to get line numbers wrong): 172 fcmped %fcc1, %f32, %f10 173 fmovd %f8, %f10 174 fmovdg %fcc1, %f32, %f10 175 fzero %f8 176 fcmped %fcc1, %f12, %f8 177 fbule,pt %fcc1, .LL11 178 fsubd %f32, %f12, %f14 179 fcmped %fcc2, %f10, %f12 180 fbg,a,pt %fcc2, .LL17
Created attachment 6209 [details] minimal test case
Created attachment 6210 [details] Output of compiling z.i with -O -fcall-used-g6
I want to say this is binutils bug from the sparc target header: SPARC has 32 integer registers and 32 floating point registers. 64 bit SPARC has 32 additional fp regs, but the odd numbered ones are not accessible. We still account for them to simplify register computations (eg: in CLASS_MAX_NREGS). There are also 4 fp condition code registers, so 32+32+32+4 == 100. Register 100 is used as the integer condition code register. Register 101 is used as the soft frame pointer register. */
Or it means that it does not pass the correct option to gas.
Can you provide how you bootstrapped and also the output of "gcc -v options"
Here's how I configured the bootstrap gcc: ../gcc-3.4.0/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2 --with-local-prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/sparc64-unknown-linux-gnu --disable-multilib --with-newlib --disable-multilib --with-cpu=ultrasparc3 --without-headers --disable-nls --enable-threads=no --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --disable-shared Here's the output of 'gcc -v options' (hmm, I must misunderstand what you wanted): sparc64-unknown-linux-gnu-gcc -v options sparc64-unknown-linux-gnu-gcc: options: No such file or directory Reading specs from /opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/lib/gcc/sparc64-unknown-linux-gnu/3.4.0/specs Configured with: /home/dank/wk/crosstool-0.28-rc9/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/gcc-3.4.0/configure --target=sparc64-unknown-linux-gnu --host=i686-host_pc-linux-gnu --prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2 --with-local-prefix=/opt/crosstool/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/sparc64-unknown-linux-gnu --disable-multilib --with-newlib --disable-multilib --with-cpu=ultrasparc3 --without-headers --disable-nls --enable-threads=no --enable-symvers=gnu --enable-__cxa_atexit --enable-languages=c --disable-shared Thread model: single gcc version 3.4.0 Full log is online at http://kegel.com/crosstool/pr15247.txt.gz To reproduce: wget http://kegel.com/crosstool/crosstool-0.28-rc10.tar.gz tar -xzvf crosstool-0.28-rc10.tar.gz cd crosstool-0.28-rc10 sudo mkdir -p /opt/crosstool sudo chown $USER /opt/crosstool sh demo-sparc64.sh Jakub's been dealing with these, so I'm cc'ing him on this.
"options" == options to compile the file.
Created attachment 6211 [details] Log of real gcc command that failed, rerun with -v
I'd find it surprising that gas gets line numbers wrong. So it appears to be complaining about 174 fmovdg %fcc1, %f32, %f10 which is fully valid as far as I know. 'fmovsg' would be problematic. Could you manually reduce the assembly file so as to narrow down the problem to a single line?
What binutils did you use? I certainly cannot reproduce this with current CVS binutils. Make sure you have: 2004-04-20 Jakub Jelinek <jakub@redhat.com> * sparc-opc.c (fmoviccx, fmovfccx, fmovccx): Define. (fmovicc, fmovfcc, fmovcc): Remove fpsize argument, change opcode to suffix. Use fmov*x macros, create all 3 fpsize variants in one macro. Adjust all users. opcodes patch.
I am using binutils-2.15.90.0.3. Your patch seems to have solved my problem. So I guess my bug report was invalid. Sorry for the noise, and thanks for the help!
How do I get the 2004-04-20 opcodes patch that Jakub mentioned? I get same errors from binutils 2.15.
From binutils cvs, i.e. http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/sparc-opc.c.diff?r1=1.9&r2=1.10&cvsroot=src
*** Bug 23222 has been marked as a duplicate of this bug. ***
Subject: Re: gas complains "There are only 32 single precision f registers; [0-31]" when compiling glibc-2.3.2/math/dosincos.c I'm not sure that this is the same bug since the bug indicates it's a bug in binutils. I am running a version of binutils that has the fix and am still experiencing this problem. I am running with binutils 2.16.1. -Aaron > >