* src/SDCCmain.c: fixed --help
[fw/sdcc] / src / SDCCast.c
index 66452408a22bd8a0763695d22b88918b499262ae..dc7452705035f00cf057829a4abca9e9da4d7389 100644 (file)
@@ -747,7 +747,7 @@ processParms (ast *func,
     }
 
   /* decorate parameter */
-  resultType = defParm ? getResultTypeFromType (defParm->etype) :
+  resultType = defParm ? getResultTypeFromType (defParm->type) :
                          RESULT_TYPE_NONE;
   *actParm = decorateType (*actParm, resultType);
 
@@ -1497,7 +1497,7 @@ isLabelInAst (symbol * label, ast * tree)
 /* isLoopCountable - return true if the loop count can be determi- */
 /* -ned at compile time .                                          */
 /*-----------------------------------------------------------------*/
-bool
+static bool
 isLoopCountable (ast * initExpr, ast * condExpr, ast * loopExpr,
                  symbol ** sym, ast ** init, ast ** end)
 {
@@ -1522,6 +1522,10 @@ isLoopCountable (ast * initExpr, ast * condExpr, ast * loopExpr,
   else
     return FALSE;
 
+  /* don't reverse loop with volatile counter */
+  if (IS_VOLATILE ((*sym)->type))
+    return FALSE;
+
   /* for now the symbol has to be of
      integral type */
   if (!IS_INTEGRAL ((*sym)->type))
@@ -1927,7 +1931,7 @@ isConformingBody (ast * pbody, symbol * sym, ast * body)
 /* if the for loop is reversible. If yes will set the value of     */
 /* the loop control var & init value & termination value           */
 /*-----------------------------------------------------------------*/
-bool
+static bool
 isLoopReversible (ast * loop, symbol ** loopCntrl,
                   ast ** init, ast ** end)
 {