public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug target/15302] New: gcc  not consistent for passing structures with complex in them
@ 2004-05-05 19:43 hjl at lucon dot org
  2004-05-13 12:03 ` [Bug target/15302] " hjl at lucon dot org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: hjl at lucon dot org @ 2004-05-05 19:43 UTC (permalink / raw)
  To: gcc-bugs

According to ABI structures are classified based on 8bytes recrsively to 
determine if they are passed in register or memory.  The 2 examples below pass 
similiar structures (according to ABI complex should be treated as struct with 
2 floats) but gcc uses memory in one case (call to bar1) and registers in the 
other case (call to foo1)
#include "complex.h"
struct st{
   int s1;
   float complex x;
   int s2;
} st1;
bar()
{
   bar1(st1);
}
/**********************
LCFI2:
        movq    st1(%rip), %rax
        movq    %rax, (%rsp)
        movq    st1+8(%rip), %rax
        movq    %rax, 8(%rsp)
        movl    $0, %eax
        call    bar1
**********************/
typedef struct { float r, i; } _complex;
struct stc{
   int s1;
   _complex x;
   int s2;
}st2;
foo()
{
   foo1(st2);
}

/**********************
.LCFI4:
        movq    st2(%rip), %rdi
        movq    st2+8(%rip), %rsi
        movl    $0, %eax
        call    foo1
**********************/

-- 
           Summary: gcc  not consistent for passing structures with complex
                    in them
           Product: gcc
           Version: 3.4.1
            Status: UNCONFIRMED
          Keywords: ABI
          Severity: critical
          Priority: P2
         Component: target
        AssignedTo: jh at suse dot cz
        ReportedBy: hjl at lucon dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-05-21  0:11 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-05-05 19:43 [Bug target/15302] New: gcc not consistent for passing structures with complex in them hjl at lucon dot org
2004-05-13 12:03 ` [Bug target/15302] " hjl at lucon dot org
2004-05-18 17:11 ` hjl at lucon dot org
2004-05-18 18:42 ` [Bug target/15302] [3.3/3.4 only] " cvs-commit at gcc dot gnu dot org
2004-05-18 19:01 ` cvs-commit at gcc dot gnu dot org
2004-05-22  1:42 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).