> If set_len really does 'ignore' signedness, then we are not treating X > as having signedness SGN.
It does not, my interpretation is that it sign-extends when the value is not already sign-extended, probably for the reason exposed by Richard. But that's admittedly quite confusing so a comment by the author would be in order. -- Eric Botcazou