| Issue |
209125
|
| Summary |
[clang] apcs-gnu struct alignment incompatible with gcc
|
| Labels |
|
| Assignees |
|
| Reporter |
miriamlefae
|
The following test case,
```c
#include <stdint.h>
struct S1
{
uint32_t a:8;
uint32_t b:8;
uint32_t c:8;
uint32_t d:8;
uint16_t e:5;
uint16_t f:3;
uint16_t l;
};
struct S2
{
uint16_t e:5;
uint16_t f:3;
};
int foo()
{
return _Alignof(struct S1);
}
int bar()
{
return _Alignof(struct S2);
}
```
Results in an **alignment of 2 and 1** respectively for structs `S1` and `S2` with [clang](https://godbolt.org/z/6P45G339d) while with [gcc](https://godbolt.org/z/PK6MT7fa4) the alignment is **4 for both**.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs