bool bitfield += complex gets infinite loop
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
The following code gets an infinity loop at runtime.
```c
#include /* assert */
#include /* offsetof */
#include /* FLT_SNAN */
#include /* FLT_CMPLX */
#include /* wchar_t */
#include /* 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;
}
```
Contributor guide
Research direction
Start by compiling and running the standalone C reproducer from the issue, confirming the infinite loop and recording the compiler version and options. Trace the relevant compiler behavior for the bool bitfield compound assignment involving a complex value; done when the reproducer no longer loops and the resulting behavior is covered by a regression test.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100