From 4ad55de132ea2a1b260597e4a731704a6ed4f0a5 Mon Sep 17 00:00:00 2001 From: johanknol Date: Sun, 11 Nov 2001 21:57:07 +0000 Subject: [PATCH] fixed bug #479725 git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@1571 4a8a32a2-be11-0410-ad9d-d568d2c75423 --- src/SDCCast.c | 17 ++--------------- src/SDCCicode.c | 6 +----- 2 files changed, 3 insertions(+), 20 deletions(-) diff --git a/src/SDCCast.c b/src/SDCCast.c index ff0aba48..f04159bf 100644 --- a/src/SDCCast.c +++ b/src/SDCCast.c @@ -662,20 +662,7 @@ processParms (ast * func, return 0; } - /* The ternary ('?') operator is weird: the ftype of the - * operator is the type of the condition, but it will return a - * (possibly) different type. - */ - if (IS_TERNARY_OP(actParm)) - { - assert(IS_COLON_OP(actParm->right)); - assert(actParm->right->left); - ftype = actParm->right->left->ftype; - } - else - { - ftype = actParm->ftype; - } + ftype = actParm->ftype; /* If it's a small integer, upcast to int. */ if (IS_INTEGRAL (ftype) @@ -2856,7 +2843,7 @@ decorateType (ast * tree) return tree->right->right ; } } else { - TTYPE (tree) = RTYPE(tree); // #HACK LTYPE(tree). + TTYPE (tree) = RTYPE(tree); TETYPE (tree) = getSpec (TTYPE (tree)); } return tree; diff --git a/src/SDCCicode.c b/src/SDCCicode.c index db9a777f..ee41b1c2 100644 --- a/src/SDCCicode.c +++ b/src/SDCCicode.c @@ -2292,10 +2292,6 @@ geniCodeBitwise (operand * left, operand * right, { iCode *ic; - // bitwise operations must be done unsigned - // WHY ? causes very bad things to happen with CSE - // SPEC_USIGN(resType)=1; - left = geniCodeCast (resType, left, TRUE); right = geniCodeCast (resType, right, TRUE); @@ -2569,7 +2565,7 @@ geniCodeConditional (ast * tree,int lvl) true = ast2iCode (tree->right->left,lvl+1); /* move the value to a new Operand */ - result = newiTempOperand (operandType (true), 0); + result = newiTempOperand (tree->right->ftype, 0); geniCodeAssign (result, geniCodeRValue (true, FALSE), 0); /* generate an unconditional goto */ -- 2.47.2