[Bug c/98572] Unexpected signed extension for unsigned bit fields

2021-01-06 Thread jakub at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98572 Jakub Jelinek changed: What|Removed |Added CC||jakub at gcc dot gnu.org --- Comment #4

[Bug c/98572] Unexpected signed extension for unsigned bit fields

2021-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98572 Andrew Pinski changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c/98572] Unexpected signed extension for unsigned bit fields

2021-01-06 Thread vonchun at gmail dot com via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98572 --- Comment #2 from Chun Feng --- Hi Pinskia: Thanks for looking into this. This is my understanding: As rules from https://wiki.sei.cmu.edu/confluence/display/c/INT02-C.+Understand+integer+conversion+rules 1. If both operands have the same

[Bug c/98572] Unexpected signed extension for unsigned bit fields

2021-01-06 Thread pinskia at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98572 --- Comment #1 from Andrew Pinski --- >Even if integer promotion happens, it should be promoted as "unsigned int" as >well. Why do you think it should be promoted to unsigned int rather int? Since a 24bit unsigned int fits into a 32 bit singed