* src/SDCCsymt.c (computeType): added optimization for 'cond ? true : false'
authorMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 9 Jun 2007 13:20:47 +0000 (13:20 +0000)
committerMaartenBrock <MaartenBrock@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Sat, 9 Jun 2007 13:20:47 +0000 (13:20 +0000)
git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@4842 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCCsymt.c

index 812eccc842d12b946e1e943d6dcb886da84c3c58..39b149e4c5655a52caa2686b56b3a205470df6f8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -4,6 +4,7 @@
          can also be static, fixes bug 1733438
        * src/SDCCsymt.c (checkSClass): static local vars in reentrant funcs can
          have absolute address too
+         (computeType): added optimization for 'cond ? true : false'
        * support/regression/tests/absolute.c: added test for static absolute var
 
 2007-06-08 Raphael Neider <rneider AT web.de>
index 0870e7e409d5c6eabf01e6b8f76d84d422430620..8e0f402f0c80d5f55c46e027f7c99807a3c8b962 100644 (file)
@@ -1904,6 +1904,17 @@ computeType (sym_link * type1, sym_link * type2,
 
   switch (resultType)
     {
+      case RESULT_TYPE_IFX:
+        if (TARGET_IS_HC08)
+          break;
+        //fallthrough
+      case RESULT_TYPE_BIT:
+        if (op == ':')
+          {
+            SPEC_NOUN (reType) = V_BIT;
+            return rType;
+          }
+        break;
       case RESULT_TYPE_CHAR:
         if (IS_BITVAR (reType))
           {