Issue 85387
Summary [x86_64] X86_64 backend pass struct argument wrong due to align.
Labels new issue
Assignees
Reporter CoTinker
    demo.c
```
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

typedef long long Tal4llong __attribute__((aligned (4))); 
struct S271 {
    int a;
    Tal4llong b;
};
struct S271 s271;

void check271 (struct S271 arg) {
    printf("arg.b:%llx\n", arg.b);
    if (arg.b != s271.b)
        printf("Fail\n");
}

int main (void) {
 s271.b = 0x7ffffffff;
    check271 (s271);
}
```
output:

https://godbolt.org/z/jP77GWad6

gcc
```
arg.b:7ffffffff
```
clang
```
arg.b:7f9cffffffff
Fail
```
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to