<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/163140>163140</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
bool bitfield += complex gets infinite loop
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
tydeman
</td>
</tr>
</table>
<pre>
The following code gets an infinity loop at runtime.
#include <assert.h> /* assert */
#include <stddef.h> /* offsetof */
#include <float.h> /* FLT_SNAN */
#include <complex.h> /* FLT_CMPLX */
#include <wchar.h> /* wchar_t */
#include <stdio.h> /* printf */
int main(void){
if(1){
struct bit2 {
unsigned int uibf : 7;
signed int sibf : 7;
bool bobf : 1;
} bits = { 1u, 1, 1 };
struct bit2 res;
res.bobf = bits.bobf += CMPLXF( 1.5f, 1.5f );
}
return 0;
}
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U01vnDAQ_TXDZRRkhv2AA4dNUk5pVKk59BYZbC-ujL2yTdL995WBaFerbhHC4s17b_z1eAj6aKVsYPsI2-eMT3FwvolnIUdus86Jc_M2SFTOGPep7RF7JyQeZQzILWqrtNXxjMa5E_KIfrJRjzIHdkgvldr2ZhISoXziIUgf8wHKb8BqoBbogAuIQIcE3EpCFEKqG4lTKsjo1D2RMo7ftmlf3t5_vh5e72l6N56M_PMP1dP3Hy-_7sk--4H7G9GMvf9vSdrdSE5e23i1Hm0jjlxboOrDaQFUw_4R2AFRK6CquAIQQ_RTH7HTkfCCIk52PlqByW3SnUIoD7iH8kJBvKKEO5Tl6Zwz2LmVUlwosH9OvQNC-Zz6YzEBPWExf1L1Qr2eqZfhUvAy5Kv3Yrb-0WMC5hNogSos8q2affNtqtZfDqlLGr2Mk7fIFnxBM9GUoi5rnsmm2O9YuaGKsWxo2K7nXKi-rnomd321qYt9TaJSoqRuJ3imG2K0LVhRsortNiznvO6VUoKE2hIVDDZMjlyb3JiPMXf-mOkQJtkUu7LYsMzwTpowJ4vIyk-cq0CUguabJHropmOADTM6xHCxiToa2SxbrqPS0oivzVgv6pLANX5yjl82edMMMZ4ClPM9ovao4zB1ee9GoDa5r8PDybvfso9A7TynANSuk_5o6G8AAAD__-AXLds">