Bug 15247 - gas complains "There are only 32 single precision f registers; [0-31]" when compiling glibc-2.3.2/math/dosincos.c
Summary: gas complains "There are only 32 single precision f registers; [0-31]" when ...
Status: RESOLVED INVALID
Alias: None
Product: gcc
Classification: Unclassified
Component: target (show other bugs)
Version: 3.4.0
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-code
: 23222 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-05-02 00:04 UTC by dank
Modified: 2005-08-04 13:14 UTC (History)
5 users (show)

See Also:
Host:
Target: sparc64-linux
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
minimal test case (609 bytes, text/plain)
2004-05-02 00:05 UTC, dank
Details
Output of compiling z.i with -O -fcall-used-g6 (995 bytes, text/plain)
2004-05-02 00:06 UTC, dank
Details
Log of real gcc command that failed, rerun with -v (1.32 KB, text/plain)
2004-05-02 05:41 UTC, dank
Details

Note You need to log in before you can comment on or make changes to this bug.
Description dank 2004-05-02 00:04:23 UTC
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
Comment 1 dank 2004-05-02 00:05:31 UTC
Created attachment 6209 [details]
minimal test case
Comment 2 dank 2004-05-02 00:06:37 UTC
Created attachment 6210 [details]
Output of compiling z.i with -O  -fcall-used-g6
Comment 3 Andrew Pinski 2004-05-02 00:15:06 UTC
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.  */
Comment 4 Andrew Pinski 2004-05-02 00:23:11 UTC
Or it means that it does not pass the correct option to gas.
Comment 5 Andrew Pinski 2004-05-02 00:23:58 UTC
Can you provide how you bootstrapped and also the output of "gcc -v options"
Comment 6 dank 2004-05-02 00:50:32 UTC
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.
Comment 7 Andrew Pinski 2004-05-02 00:54:04 UTC
"options" == options to compile the file.
Comment 8 dank 2004-05-02 05:41:00 UTC
Created attachment 6211 [details]
Log of real gcc command that failed, rerun with -v
Comment 9 Eric Botcazou 2004-05-02 06:40:00 UTC
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?
Comment 10 Jakub Jelinek 2004-05-02 07:54:14 UTC
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.
Comment 11 dank 2004-05-02 19:06:42 UTC
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!
Comment 12 devsk 2004-05-25 00:48:24 UTC
How do I get the 2004-04-20 opcodes patch that Jakub mentioned? I get same
errors from binutils 2.15.
Comment 13 devsk 2004-05-25 03:05:02 UTC
How do I get the 2004-04-20 opcodes patch that Jakub mentioned? I get same
errors from binutils 2.15.
Comment 15 Andrew Pinski 2005-08-04 01:36:38 UTC
*** Bug 23222 has been marked as a duplicate of this bug. ***
Comment 16 aaron_williams 2005-08-04 01:58:53 UTC
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

>  
>
Comment 17 Andrew Pinski 2005-08-04 13:14:39 UTC
*** Bug 23222 has been marked as a duplicate of this bug. ***