projects
/
fw
/
sdcc
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
* src/mcs51/gen.c (outBitC, genRet): used IS_OP_RUONLY,
[fw/sdcc]
/
src
/
SDCCast.c
diff --git
a/src/SDCCast.c
b/src/SDCCast.c
index d48f3c00126d2af0f60a0e136402998bbd26587e..84bbdd8f67d8b0cffb202b0fd7a3383da8b9f725 100644
(file)
--- a/
src/SDCCast.c
+++ b/
src/SDCCast.c
@@
-2280,6
+2280,7
@@
resultTypePropagate (ast *tree, RESULT_TYPE resultType)
{
case AND_OP:
case OR_OP:
{
case AND_OP:
case OR_OP:
+ case '!':
return resultType;
case '=':
case '?':
return resultType;
case '=':
case '?':
@@
-4153,7
+4154,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
if (IS_LITERAL(RTYPE(tree)) &&
floatFromVal (valFromType (RETYPE (tree))) == 0 &&
tree->opval.op == EQ_OP &&
if (IS_LITERAL(RTYPE(tree)) &&
floatFromVal (valFromType (RETYPE (tree))) == 0 &&
tree->opval.op == EQ_OP &&
-
resultType == RESULT_TYPE_IFX
)
+
(resultType == RESULT_TYPE_IFX || resultType == RESULT_TYPE_BIT)
)
{
tree->opval.op = '!';
tree->right = NULL;
{
tree->opval.op = '!';
tree->right = NULL;
@@
-4208,7
+4209,7
@@
decorateType (ast * tree, RESULT_TYPE resultType)
}
LRVAL (tree) = RRVAL (tree) = 1;
}
LRVAL (tree) = RRVAL (tree) = 1;
- TTYPE (tree) = TETYPE (tree) =
newBoolLink
();
+ TTYPE (tree) = TETYPE (tree) =
(resultType == RESULT_TYPE_BIT) ? newBoolLink() :newCharLink
();
/* condition transformations */
{
/* condition transformations */
{
@@
-5757,8
+5758,8
@@
optimizeCompare (ast * root)
root->right->opval.val : NULL);
/* if left is a BITVAR in BITSPACE */
root->right->opval.val : NULL);
/* if left is a BITVAR in BITSPACE */
- /* and right is a LITERAL then
opt-
*/
- /*
imize else do nothing
*/
+ /* and right is a LITERAL then
*/
+ /*
optimize else do nothing
*/
if (vleft && vright &&
IS_BITVAR (vleft->etype) &&
IN_BITSPACE (SPEC_OCLS (vleft->etype)) &&
if (vleft && vright &&
IS_BITVAR (vleft->etype) &&
IN_BITSPACE (SPEC_OCLS (vleft->etype)) &&