* src/SDCC.y (pointer): fixed bug #846006
authorepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 26 Nov 2003 07:33:32 +0000 (07:33 +0000)
committerepetrich <epetrich@4a8a32a2-be11-0410-ad9d-d568d2c75423>
Wed, 26 Nov 2003 07:33:32 +0000 (07:33 +0000)
* support/Util/SDCCerr.c: made W_PTR_TYPE_INVALID message clearer
* src/SDCCast.c (decorateType): fixed bug #846009
* src/ds390/peeph.def,
* src/ds390/gen.c (genAnd, genOr),
* src/mcs51/peeph.def,
* src/mcs51/gen.c (genAnd, genOr): fixed bug #846777

git-svn-id: https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc@3027 4a8a32a2-be11-0410-ad9d-d568d2c75423

ChangeLog
src/SDCC.y
src/SDCCast.c
src/ds390/gen.c
src/ds390/peeph.def
src/mcs51/gen.c
src/mcs51/peeph.def
support/Util/SDCCerr.c

index 74a856cad808dbdf659b010135b9a07157898702..e9968daaed0bde6a56b9bc6e03ab6fd4237adf30 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2003-11-26 Erik Petrich <epetrich@ivorytower.norman.ok.us>
+
+       * src/SDCC.y (pointer): fixed bug #846006
+       * support/Util/SDCCerr.c: made W_PTR_TYPE_INVALID message clearer
+       * src/SDCCast.c (decorateType): fixed bug #846009
+       * src/ds390/peeph.def,        
+       * src/ds390/gen.c (genAnd, genOr),
+       * src/mcs51/peeph.def,        
+       * src/mcs51/gen.c (genAnd, genOr): fixed bug #846777
+
 2003-11-25 Erik Petrich <epetrich@ivorytower.norman.ok.us>
 
        Fixed several common-sub-expression bugs (#772861, #768380, & #755323)
index fa781d1db136076e8c841b677f2fd7fbca7922b5..aaee44acb5b22e6710ba173db6133b08bc60db42 100644 (file)
@@ -1042,10 +1042,14 @@ pointer
    : unqualified_pointer { $$ = $1 ;}
    | unqualified_pointer type_specifier_list   
          {
-            $$ = $1  ;         
-            DCL_TSPEC($1) = $2;
-             DCL_PTR_CONST($1) = SPEC_CONST($2);
-             DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2);
+            $$ = $1  ;
+             if (IS_SPEC($2)) {
+                DCL_TSPEC($1) = $2;
+                 DCL_PTR_CONST($1) = SPEC_CONST($2);
+                 DCL_PTR_VOLATILE($1) = SPEC_VOLATILE($2);
+             }
+             else
+                 werror (W_PTR_TYPE_INVALID);
         }
    | unqualified_pointer pointer         
          {
index a788e69a85bf4b30c624b902f14c1979b06469e4..fcf18e220e2559e82f311c62bf240018ce02f156 100644 (file)
@@ -2383,7 +2383,7 @@ decorateType (ast * tree)
          goto errorTreeReturn;
        }
 
-      if (SPEC_SCLS (tree->left->etype) == S_REGISTER)
+      if (LETYPE(tree) && SPEC_SCLS (tree->left->etype) == S_REGISTER)
        {
          werror (E_ILLEGAL_ADDR, "address of register variable");
          goto errorTreeReturn;
@@ -2406,7 +2406,9 @@ decorateType (ast * tree)
          werror (E_LVALUE_REQUIRED, "address of");
          goto errorTreeReturn;
        }
-      if (SPEC_SCLS (tree->left->etype) == S_CODE)
+      if (!LETYPE (tree))
+        DCL_TYPE (p) = POINTER;
+      else if (SPEC_SCLS (tree->left->etype) == S_CODE)
        DCL_TYPE (p) = CPOINTER;
       else if (SPEC_SCLS (tree->left->etype) == S_XDATA)
        DCL_TYPE (p) = FPOINTER;
index 8a55bcd48a28acfc369a97e779ea3a537a78e460..b75d20b30d1ba02b288d08a601eb60d6b8f3a1b5 100644 (file)
@@ -6387,6 +6387,8 @@ genAnd (iCode * ic, iCode * ifx)
            {
              if (ifx)
                jmpTrueOrFalse (ifx, tlbl);
+              else
+               emitcode ("", "!tlabeldef", tlbl->key + 100);
              goto release;
            }
        }
@@ -6477,6 +6479,8 @@ genAnd (iCode * ic, iCode * ifx)
            }
          else if (ifx)
            jmpTrueOrFalse (ifx, tlbl);
+          else
+           emitcode ("", "!tlabeldef", tlbl->key + 100);
        }
       else
        {
@@ -6795,6 +6799,8 @@ genOr (iCode * ic, iCode * ifx)
            }
          else if (ifx)
            jmpTrueOrFalse (ifx, tlbl);
+          else
+           emitcode ("", "!tlabeldef", tlbl->key + 100);
        }
       else
        {
index be3ff93aa913a4eb0eb0b5350ea295f5d2fa1c0a..7ffbf7103ff32e6f838f7405f35a8bce3aec99fa 100644 (file)
@@ -2693,3 +2693,17 @@ replace {
         jz      %4
 %1:
 } if labelRefCount %1 1
+
+replace {
+        jnz     %1
+%1:
+} by {
+        ;       Peephole 243a    jump optimization
+} if labelRefCount %1 1
+
+replace {
+        jz      %1
+%1:
+} by {
+        ;       Peephole 243b    jump optimization
+} if labelRefCount %1 1
index c6b24c9b1f3596980af19175e12722b752bdb7a6..8cad6c3c944a2d1f174a4d24c10f20baea1963f2 100644 (file)
@@ -4922,6 +4922,8 @@ genAnd (iCode * ic, iCode * ifx)
            {
              if (ifx)
                jmpTrueOrFalse (ifx, tlbl);
+              else
+               emitcode ("", "%05d$:", tlbl->key + 100);
              goto release;
            }
        }
@@ -5012,6 +5014,8 @@ genAnd (iCode * ic, iCode * ifx)
            }
          else if (ifx)
            jmpTrueOrFalse (ifx, tlbl);
+          else
+           emitcode ("", "%05d$:", tlbl->key + 100);
        }
       else
        {
@@ -5298,6 +5302,8 @@ genOr (iCode * ic, iCode * ifx)
            }
          else if (ifx)
            jmpTrueOrFalse (ifx, tlbl);
+         else
+           emitcode ("", "%05d$:", tlbl->key + 100);
        }
       else
        for (; (size--); offset++)
index 518dd7967c1b8d8734a5fc570c3913e3c14a1206..f3b8f704c9f75bbfc9def38d0e7804d4af4db6b7 100644 (file)
@@ -3055,3 +3055,16 @@ replace {
         movx    @dptr,a
 }
 
+replace {
+        jnz     %1
+%1:
+} by {
+        ;       Peephole 249a    jump optimization
+} if labelRefCount %1 1
+
+replace {
+        jz      %1
+%1:
+} by {
+        ;       Peephole 249b    jump optimization
+} if labelRefCount %1 1
index 0770abd44d27eca9f6d9141445ddcc8a022635f7..04309fadf0614f4a5c1ab84d3420415aefded197 100644 (file)
@@ -276,7 +276,7 @@ struct
 { W_CONTROL_FLOW, ERROR_LEVEL_PEDANTIC,
    "conditional flow changed by optimizer '%s(%d)':so said EVELYN the modified DOG" },
 { W_PTR_TYPE_INVALID, ERROR_LEVEL_WARNING,
-   "invalid type specifier for pointer type specifier ignored" },
+   "invalid type specifier for pointer type; specifier ignored" },
 { W_IMPLICIT_FUNC, ERROR_LEVEL_WARNING,
    "function '%s' implicit declaration" },
 { W_CONTINUE, ERROR_LEVEL_WARNING,