Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Bit-field sign extension pattern results in redundant shifts #89
See here: https://cx.rv8.io/g/JtEZL6
but really should be:
should probably be raised as a bug on upstream gcc as it affects x86. It's shifting by 24 then by 3. There must be some target independent logic that splits shifts for bitfield accesses. We can link to this bug in an email, and the gcc developers can raise an upstream bug, if they believe it is a bug, so we can get a fix into a point release.
This bug appears to be target independent. I've confirmed the same code-gen is present in a Dec 2016 gcc 6.1.0 build. It's almost as if gcc is narrowing to a
Hey. It is. It breaks into 'char' or 'short' before doing the remaining shift amount, and it does so on aarch64 aswell. We should probably file a bug in GCC bugzilla: