> So, if you have int16 target, where unsigned int is 16-bit and UINT_MAX > 65535, then shift count must be >= 0 and < 16, therefore, 2U << 31 is > undefined behavior.
Well, if the shift count is masked by the target, if will be masked according to the width of the register and the result will nevertheless be zero. -- Eric Botcazou