Commit c706dd4
[CIR][Lowering] fixes return value for = operator for bitfields (llvm#1247)
Basically that is - the return value for `=` operator for bitfield
assignment is wrong now. For example, the next function returns `7` for
3 bit bit field, though it should be `-1`:
```
int get_a(T *t) {
return (t->a = 7);
}
```
This PR fix it. Actually, the bug was in the lowering - the integer cast
is applied in the wrong place (in comparison with the original codegen).1 parent c2fc066 commit c706dd4
File tree
2 files changed
+16
-3
lines changed- clang
- lib/CIR/Lowering/DirectToLLVM
- test/CIR/CodeGen
2 files changed
+16
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3651 | 3651 | | |
3652 | 3652 | | |
3653 | 3653 | | |
3654 | | - | |
3655 | | - | |
3656 | | - | |
3657 | 3654 | | |
3658 | 3655 | | |
3659 | 3656 | | |
| |||
3664 | 3661 | | |
3665 | 3662 | | |
3666 | 3663 | | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
3667 | 3668 | | |
3668 | 3669 | | |
3669 | 3670 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
| 4 | + | |
3 | 5 | | |
4 | 6 | | |
5 | 7 | | |
| |||
131 | 133 | | |
132 | 134 | | |
133 | 135 | | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
134 | 146 | | |
135 | 147 | | |
136 | 148 | | |
| |||
0 commit comments