Dear all, as found by the reporter, the result of the intrinsic IBITS differed from other compilers (e.g. Intel, NAG) for the corner case that the LEN argument was equal to BIT_SIZE(I), which is explicitly allowed by the standard. We actually had an inconsistency for this case between code generated by the frontend and compile-time simplified expressions. The reporter noticed that this is related to a restriction in gcc that requires that shift widths shall be smaller than the bit sizes, and we already special case this for ISHFT. It makes sense to use the same special casing for IBITS. Attached patch fixes this and regtests on x86_64-pc-linux-gnu. OK for mainline? This issue has been there for ages. Shall this be backported or left in release branches as is? Thanks, Harald