------- Comment #3 from rguenth at gcc dot gnu dot org 2008-02-12 19:59 ------- get_unwidened behaves as documented:
If FOR_TYPE is nonzero, we return a value which, if converted to type FOR_TYPE, would be equivalent to converting OP to type FOR_TYPE. thus indeed, (signed char)(int)(unsigned short)-41sc == -41sc. But the bug instead is that fold specifies FOR_TYPE, where it rather should not specify it and convert the result to shorter_type if and only if this conversion is not a truncation. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35163