* as/z80/z80mch.c: fixed bug #1704376: missing as-z80 errors
[fw/sdcc] / src / SDCClabel.c
index 718e75f90fd3f7cb30ab7d57bf7ffb90c3276be4..ba78d47900ceb109c9715d9eada48410e88a2440 100644 (file)
@@ -384,8 +384,6 @@ labelUnreach (iCode * ic)
       /* statement is not a label           */
       if (loop->op == GOTO || loop->op == RETURN)
        {
-         int warn = 0;
-
          if (loop->next &&
              (loop->next->op == LABEL ||
               loop->next->op == ENDFUNCTION))
@@ -406,22 +404,17 @@ labelUnreach (iCode * ic)
                  hTabDeleteItem (&labelRef, IC_LABEL (tic)->key, tic, DELETE_ITEM, NULL);
                  break;
                case IFX:
-                 warn = 1;
+                 werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH);
                  if (IC_TRUE (tic))
                    hTabDeleteItem (&labelRef, IC_TRUE (tic)->key, tic, DELETE_ITEM, NULL);
                  else
                    hTabDeleteItem (&labelRef, IC_FALSE (tic)->key, tic, DELETE_ITEM, NULL);
                  break;
                default:
-                 warn = 1;
-
+                 werrorfl (tic->filename, tic->lineno, W_CODE_UNREACH);
                }
            }
 
-         if (warn)
-           werrorfl (loop->next->filename, loop->next->lineno,
-                     W_CODE_UNREACH);
-
          /* now set up the pointers */
          loop->next = loop2;
          if (loop2)