+#else
+
+static value *cheapestVal (value *val)
+{
+ if (IS_FLOAT (val->type) || IS_CHAR (val->type))
+ return val;
+
+ /* - signed/unsigned must not be changed.
+ - long must not be changed.
+
+ the only possible reduction is from signed int to signed char,
+ because it's automatically promoted back to signed int.
+
+ a reduction from unsigned int to unsigned char is a bug,
+ because an _unsigned_ char is promoted to _signed_ int! */
+ if (IS_INT(val->type) &&
+ !SPEC_USIGN(val->type) &&
+ !SPEC_LONG(val->type) &&
+ SPEC_CVAL(val->type).v_int >= -128 &&
+ SPEC_CVAL(val->type).v_int < 0)
+
+ {
+ SPEC_NOUN(val->type) = V_CHAR;
+ }
+ /* 'unsigned char' promotes to 'signed int', so that we can
+ reduce it the other way */
+ if (IS_INT(val->type) &&
+ !SPEC_USIGN(val->type) &&
+ !SPEC_LONG(val->type) &&
+ SPEC_CVAL(val->type).v_int >= 0 &&
+ SPEC_CVAL(val->type).v_int <= 255)
+
+ {
+ SPEC_NOUN(val->type) = V_CHAR;
+ SPEC_USIGN(val->type) = 1;
+ }
+ return (val);
+}
+#endif
+