Update of /cvsroot/monetdb/pathfinder/compiler/core
In directory sc8-pr-cvs16.sourceforge.net:/tmp/cvs-serv31404

Modified Files:
        fs.brg 
Log Message:
Split reduce into two function.
The reason for this is that icc on Windows does not seem to reuse
stack space for local variables that are declared in peer blocks.
This means that each call to the old reduce used a lot more stack
space than in other compilers, so that we run out of stack space much
quicker than on other platforms.  By splitting the function in two and
having the bulk of the recursive calls in the first part in which only
a few local variables are declared, we can recurse much deeper and we
do not run out of stack space.
This hopefully fixes lots of crashes of pf on Windows.


Index: fs.brg
===================================================================
RCS file: /cvsroot/monetdb/pathfinder/compiler/core/fs.brg,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- fs.brg      7 Dec 2007 13:55:36 -0000       1.62
+++ fs.brg      7 Jan 2008 16:28:38 -0000       1.63
@@ -864,6 +864,7 @@
  * Reducer function. This is the heart of this source file. It
  * contains all the action code for the above burg patterns.
  */
+static void reduce_rest (PFpnode_t * p, int rule, short * nts, PFpnode_t 
*kids[MAX_KIDS]);
 static void
 reduce (PFpnode_t * p, int goalnt)
 {
@@ -872,7 +873,6 @@
                                      the current rule */
     PFpnode_t    *kids[MAX_KIDS]; /* leaf nodes of this rule */
     bool          topdown;        /* is this a top-down rule? */
-    PFcnode_t    *c;              /* temporary helper variable */
 
     /* guard against too dep recursion */
     PFrecursion_fence();
@@ -937,6 +937,14 @@
         for (unsigned short i = 0; nts[i]; i++)
             reduce (kids[i], nts[i]);
 
+    reduce_rest(p, rule, nts, kids);
+}
+
+static void
+reduce_rest (PFpnode_t * p, int rule, short * nts, PFpnode_t *kids[MAX_KIDS])
+{
+    PFcnode_t    *c;              /* temporary helper variable */
+
     /*
     PFinfo (OOPS_NOTICE, "processing rule %i", rule);
     */


-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Monetdb-pf-checkins mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/monetdb-pf-checkins

Reply via email to