[Bug target/19247] gfortran.dg/g77/6177.f is miscompiled on sparc-linux

ebotcazou at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Jan 4 06:46:00 GMT 2005


------- Additional Comments From ebotcazou at gcc dot gnu dot org  2005-01-04 06:46 -------
> MAIN__:
>         save    %sp, -112, %sp
>         st      %g0, [%fp-16]
>         st      %g0, [%fp-12]
>         call    cabsf, 0
>          add    %fp, -16, %o0
>          ^^^^  This should be an ld.

No, this is correct, see the 32-bit calling conventions for complex types as
documented in config/sparc/sparc.c.

Here's the diff between the assembly output on Solaris and Linux:

@@ -9,11 +9,11 @@
        .type   MAIN__, #function
        .proc   020
 MAIN__:
-       save    %sp, -120, %sp
-       st      %g0, [%fp-24]
-       st      %g0, [%fp-20]
+       save    %sp, -112, %sp
+       st      %g0, [%fp-16]
+       st      %g0, [%fp-12]
        call    cabsf, 0
-        add    %fp, -24, %o0
+        add    %fp, -16, %o0
        sethi   %hi(.LLC1), %g1
        ld      [%g1+%lo(.LLC1)], %f8
        fcmpes  %f0, %f8

So it's basically the same assembly and the testcase passes on Solaris.

> I have no clue what is causing this.

The runtime (specifically cabsf) was probably compiled with the old calling
conventions for complex types; it must be recompiled with GCC 3.4.x.


-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ebotcazou at gcc dot gnu dot
                   |                            |org
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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



More information about the Gcc-bugs mailing list