<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/132342>132342</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
OpenMP failing offload of static object if bitfields
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
KaruroChori
</td>
</tr>
</table>
<pre>
This works as intended:
```
struct hello{
struct sub{
uint32_t uid;
uint32_t gid ;
uint32_t idx;
uint32_t weak ;
};
#pragma omp declare target
constexpr static sub A={1,1,1,false};
#pragma omp end declare target
};
```
while this does not:
```
struct hello{
struct sub{
uint32_t uid:32;
uint32_t gid:32;
uint32_t idx:32;
uint32_t weak:32;
};
#pragma omp declare target
constexpr static sub A={1,1,1,false};
#pragma omp end declare target
};
```
Bitfields are intrinsically not working, and the error message is a generic sounding `Offloading entry for declare target variable _ZN3sdf5hello1AE is incorrect: the address is invalid.`
At the very least, a more explicit description would help but still, I see no reason why bitfields should not be allowed.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJy0lM-O2zYQxp-Gugxi0KT-ZA86aHdroCja9NBTLwEljqRpaFLgUPb67Qtqnayz3S5yiWHD0HzzaYbzI2mYafKIrajuRfVYmDXNIba_mbjG8DCHSEUf7KX9ayaGc4hfGAwD-YTeohW6E7ITtbx-ZQcAwCmuQ4IZnQuiub9GbxRe--_j-bOST1p9TrCSFfp_1YksvCOTfXpHPaP58sotmsdr4Dao9BLNdDQQjgtYHJyJCMnECdNN2hA8J3xaInAyiYa8MOiEfhTN_V6oh6-_0TjGl0JvFkFv3yj0zXQ7YyG780wOIWUoNiCDD-nK4ufg6LR6n8ltyvcw3rdmIm_k_HdYeRg_lcqP4Ljt7BWRe0ojobMM2UI-RfJMg3HukulsZ4f8JNQDGG8hzQgYY4hwRGYzIRCDgQk9xtxyWL0lP4Go5adxdMFsT-hTvMAY4qve4GQimd4hfP77D812rDba--6X_FryQ4gRh7xFtsLG2ojMz9rJOLK753V0adNPGC_g0HDa2oVjiAj4tDgaKIFFHiItiYKHc1idzVtrgX5NwImcy55fgRHBB4hoOOfNF-i_TYjnzZbH0iMY58IZ7a6wrbZ3-s4U2O6bUlW6kR9VMbdDKUdUg0RZ1ft9qXs91qYvZV018g6ru4JaJVUltdrLWpal2ulx_NjUfVP2qrRVWYtS4tGQ2zl3Ou5CnApiXrHda6VLVTjTo-PtClTK4xk2VSiVb8TYZtOHfp1YlNIRJ355TaLksP20oP_9TxgNuUwpPAODMH7dgaH_B4cENL4MoVija-eUFs4HVx2EOkyU5rXfDeEo1CGXuP59WGLIfqEOW2Ms1OHa-alV_wYAAP__io-74g">