wgtdkp / wgtcc

A small C11 compiler
MIT License
765 stars 130 forks source link

ABI problem #42

Open huangguiyang opened 7 years ago

huangguiyang commented 7 years ago
struct S {
    int a, b;
};
void bar(struct S);
void foo() {
    struct S s;
    bar(s);
}

According to the amd64 ABI,the whole s is passed by register rdi. 😒

wgtdkp commented 7 years ago

yes, I passed its address~

wgtdkp commented 7 years ago

It is tooooooooo complicate of AMD64 ABI to pass a struct......