projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/SDCCast.c (resultTypePropagate, decorateType): avoid promotion to int for compl...
[fw/sdcc]
/
src
/
SDCCval.c
diff --git
a/src/SDCCval.c
b/src/SDCCval.c
index b2f8fe0e1b0cf4db8434243e7c9913409bb91067..bbf475c15c7c29d6cf192fb274b32a3ab40a12d1 100644
(file)
--- a/
src/SDCCval.c
+++ b/
src/SDCCval.c
@@
-1044,6
+1044,10
@@
valComplement (value * val)
SPEC_CVAL (val->etype).v_uint = ~SPEC_CVAL (val->etype).v_uint;
else
SPEC_CVAL (val->etype).v_int = ~SPEC_CVAL (val->etype).v_int;
SPEC_CVAL (val->etype).v_uint = ~SPEC_CVAL (val->etype).v_uint;
else
SPEC_CVAL (val->etype).v_int = ~SPEC_CVAL (val->etype).v_int;
+ if (SPEC_NOUN(val->etype) == V_CHAR)
+ if ( SPEC_CVAL(val->etype).v_int < -128
+ || SPEC_CVAL(val->etype).v_int > 127)
+ SPEC_NOUN(val->etype) = V_INT;
}
// ~(unsigned 3) now really is signed
SPEC_USIGN(val->etype)=0;
}
// ~(unsigned 3) now really is signed
SPEC_USIGN(val->etype)=0;