fixed the first parameter push of --int-long-reent
[fw/sdcc] / src / SDCCsymt.c
index 99bb8e5a184b84788ea628ed889a76f9f965e816..9349511d9f89ec36c717e8c112ad906a43ae8c82 100644 (file)
@@ -1594,7 +1594,6 @@ processFuncArgs (symbol * func, int ignoreName)
   value *val;
   int pNum = 1;
 
-
   /* if this function has variable argument list */
   /* then make the function a reentrant one    */
   if (func->hasVargs)
@@ -1624,8 +1623,6 @@ processFuncArgs (symbol * func, int ignoreName)
          and as port dictates
          not inhibited by command line option or #pragma */
       if (!func->hasVargs &&
-         !options.noregparms &&
-         !IS_RENT (func->etype) &&
          (*port->reg_parm) (val->type))
        {
          SPEC_REGPARM (val->etype) = 1;
@@ -1639,10 +1636,19 @@ processFuncArgs (symbol * func, int ignoreName)
       pNum++;
     }
 
-  /* if this function is reentrant or */
-  /* automatics r 2b stacked then nothing */
-  if (IS_RENT (func->etype) || options.stackAuto)
-    return;
+  /* if this is an internal generated function call */
+  if (func->cdef) {
+    /* ignore --stack-auto for this one, we don't know how it is compiled */
+    /* simply trust on --int-long-reent or --float-reent */
+    if (IS_RENT(func->etype)) {
+      return;
+    }
+  } else {
+    /* if this function is reentrant or */
+    /* automatics r 2b stacked then nothing */
+    if (IS_RENT (func->etype) || options.stackAuto)
+      return;
+  }
 
   val = func->args;
   pNum = 1;