Issue 120482
Summary [AIX] Bad codegen passing packed aggregates containing PPC vectors
Labels platform:aix
Assignees
Reporter hubert-reinterpretcast
    Consider (with `-DPACKED`):
```cpp
extern "C" {
struct
#if PACKED
__attribute__((__packed__))
#endif
A {
  vector unsigned int x;
};
void g(void *p);
void f(unsigned long, A a) {
 g(&a);
}
}
```

As a packed structure, arguments of type `A` should be passed without special treatment for 16-byte alignment (https://www.ibm.com/docs/en/aix/7.3?topic=sequence-argument-passing); however, the 16-byte alignment behaviour is observed whether `-DPACKED` is specified or not.

Online compiler link: https://godbolt.org/z/314ddxcb7

Compiler invocation command:
```
clang++ --target=powerpc64-ibm-aix -DPACKED -O -S -o - -emit-llvm packedvecpassing.cc
```

Actual output (partial):
```
define void @f(i64 noundef %0, ptr noundef byval(%struct.A) align 16 %a) local_unnamed_addr #0 {
```

Expected output (partial):
```
define void @f(i64 noundef %0, ptr noundef byval(%struct.A) align 8 %a) local_unnamed_addr #0 {
```

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to