Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CIR][Lowering] fixes return value for = operator for bitfields #1247

Merged
merged 2 commits into from
Dec 20, 2024

Conversation

gitoleg
Copy link
Collaborator

@gitoleg gitoleg commented Dec 19, 2024

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).

Copy link
Collaborator

@keryell keryell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch!

@bcardosolopes
Copy link
Member

Minor conflict because of your previous merged PR, but LGTM otherwise

@gitoleg
Copy link
Collaborator Author

gitoleg commented Dec 20, 2024

updated!

@bcardosolopes bcardosolopes merged commit 2409769 into llvm:main Dec 20, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants