[Bug target/16446] Irix calling conventions for complex numbers

billingd at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Thu Jul 15 02:05:00 GMT 2004


------- Additional Comments From billingd at gcc dot gnu dot org  2004-07-15 02:05 -------
Here is some data.  I have generated assembler for the following
two subroutines.

For mipspro 7.4.1m c99

% cat my_creal.c
#include <complex.h>

double my_creal(complex double x)
{
  return creal (x);
}

and for gcc-3.5

%cat my_creal_gcc.c
extern double creal (double _Complex);

double my_creal(_Complex double x)
{
  return creal (x);
}

Here is the assembler generated at -O3

cat my_creal.s
        .file   1       "/usr/people/billingd/dev/gfortran/my_creal.c"
        .set    noreorder
        .set    noat
        #  /usr/lib32/cmplrs/be::7.41

        #-----------------------------------------------------------
        # Compiling my_creal.c (/tmp/ctmB.BAAaBjkQ1)
        #-----------------------------------------------------------

        #-----------------------------------------------------------
        # Options:
        #-----------------------------------------------------------
        #  Target:R10000, ISA:mips4, Pointer Size:32
        #  -O3  (Optimization level)
        #  -g0  (Debug level)
        #  -m1  (Report warnings)
        #-----------------------------------------------------------


        .section .text, 1, 0x00000006, 4, 64
.text:
        .section .text

        # Program Unit: my_creal
        .ent    my_creal
        .globl  my_creal
my_creal:       # 0x0
        .dynsym my_creal        sto_default
        .frame  $sp, 0, $31
        .loc    1 4 1
 #   1  #include <complex.h>
 #   2  
 #   3  double my_creal(complex double x)
 #   4  {
.BB1.my_creal:  # 0x0
 #<freq>
 #<freq> BB:1 frequency = 1.00000 (heuristic)
 #<freq>
        .loc    1 5 3
 #   5    return creal (x);
        jr $31                          # [0]  
        .loc    1 4 1
        mov.d $f0,$f12                  # [0]  
        .end    my_creal
        .section .text
        .align 6
        .gpvalue 30720


cat my_creal_gcc.s
        #.file  1 "my_creal_gcc.c"
        .option pic2
        .section .text,0x1,0x6,4,8
        .text
        .align  2
        .align  2
        .align  3
        .globl  my_creal
        .ent    my_creal
my_creal:
.LFB2:
        .frame  $sp,0,$31               # vars= 0, regs= 0/0, args= 0, gp= 0
        .mask   0x00000000,0
        .fmask  0x00000000,0
        .set    noreorder
        .set    nomacro
        
        dmtc1   $4,$f0
        j       $31
        nop

        .set    macro
        .set    reorder
.LFE2:
        .end    my_creal


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rsandifo at redhat dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16446



More information about the Gcc-bugs mailing list