<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/58304>58304</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`Incorrect alignment of argument passed to called function!` on packed struct
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pirama-arumuga-nainar
</td>
</tr>
</table>
<pre>
Command:
```
$ clang "-cc1" "-triple" "aarch64-unknown-linux-android10000" "-emit-obj" "--mrelax-relocations" "-mnoexecstack" "-disable-free" "-target-cpu" "cortex-a55" "-target-feature" "+neon" "-target-feature" "+v8.2a" "-target-feature" "+fix-cortex-a53-835769" "-target-abi" "aapcs" "-O2" "-std=gnu++17" "-vectorize-loops" "-vectorize-slp" "-x" "c++" "packed_struct_align.cpp"
Incorrect alignment of argument passed to called function!
%19 = tail call i8488 @llvm.vector.reduce.or.v16i8488(<16 x i8488> %18)
in function _Z1qv
fatal error: error in backend: Broken function found, compilation aborted!
```
Source:
```
struct __attribute__((__packed__)) {
short : 8411;
char a : 8;
char b : 8;
char c : 8;
char d : 8;
char e : 6;
char f : 6;
char g : 6;
char h : 6;
char i : 4;
char j : 4;
char k : 4;
char l : 4;
char m : 1;
char n : 1;
char aa : 1;
char ab : 1;
} am;
int al[64];
int o, p;
void q() {
am.a = p;
am.e = o;
am.i = al[4];
am.m = al[5];
am.b = al[0];
am.f = al[1];
am.j = p;
am.n = am.c = al[8];
am.g = al[9];
am.k = al[0];
am.aa = am.d = al[56];
am.h = al[57];
am.l = al[8];
am.ab = al[9];
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJylVMuSmzgU_Rq8UUGBeHrBIm5PqmaVRXazoS5CYHULiQjheObr5yJs3G3TySIuykjn3LfQqXXzb_mi-x5U48VfvPDohV-8LLw-y5YmhElQHfEo9RmL8OWW1ohB8usOwLBTlviTelP6p_KlUNPF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