https://gcc.gnu.org/bugzilla/show_bug.cgi?id=110407

            Bug ID: 110407
           Summary: [12/13/14 Regression] Overaligned struct return
                    depending on different versions of GCC
           Product: gcc
           Version: 14.0
            Status: UNCONFIRMED
          Keywords: ABI
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pinskia at gcc dot gnu.org
  Target Milestone: ---
            Target: x86_64-linux-gnu

Take:
```

typedef unsigned uint;
struct  cpuid_abcd_t
{
    uint eax;
    uint ebx;
    uint ecx;
    uint edx;
}  __attribute__((aligned(8*4)));

struct cpuid_abcd_t
cpuid_insn(const uint in_eax)
{
        struct cpuid_abcd_t ret={};

        asm (
            "cpuid"
            :
                "=a" ( ret.eax ),
                "=b" ( ret.ebx ),
                "=c" ( ret.ecx ),
                "=d" ( ret.edx )
            :
                "a"  ( in_eax )
    );
        return ret;
}
```

GCC 12+ returns this in the vector register. While before it was returned via a
pointer that was in rdi .

Reply via email to