https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109750
Bug ID: 109750 Summary: Incorrect code generated for shifted bit field Product: gcc Version: 9.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: jim.gray at atos dot net Target Milestone: --- Created attachment 55008 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=55008&action=edit Tar file with source, assembly listing, compile script, executable Attached is a simple program that shows the problem encountered. Bad output when compiling with GCC compiler on Ubuntu ~/gcc-bug$ ./gccbug Source = 000000020000 Target = 000000000200 Target = 1777777777760000000200 Good output when compiling with MS C++ compiler on Windows: >gccbug Source = 000000020000 Target = 000000000200 Target = 020000000200