Author: shihui
Date: 2011-04-06 02:03:01 -0400 (Wed, 06 Apr 2011)
New Revision: 3537
Modified:
trunk/osprey/be/com/constraint_graph.cxx
trunk/osprey/be/com/constraint_graph_solve.cxx
Log:
Fix bug753:
There are two main issue in ConstraintGraph::processInito and
ConstraintGraph::processInitv
1. In ConstraintGraph::processInito, mem_pool is initialized and not deleted at
early exit point. Cause some mem_pool not free.
2. Recursively call ConstraintGraph::processInitValues(ST) without guard if
this ST is already processed. Cause allocate more unfreed mem_pool
Fix
1. Call mem_pool_delete in early exit in ConstraintGraph::processInito
2. Check if an ST is already processed when recursively got ST's initialized
point_to.
3. Clear local points_to variable.
Code Review: Sun Chan
Modified: trunk/osprey/be/com/constraint_graph.cxx
===================================================================
--- trunk/osprey/be/com/constraint_graph.cxx 2011-04-06 05:54:02 UTC (rev
3536)
+++ trunk/osprey/be/com/constraint_graph.cxx 2011-04-06 06:03:01 UTC (rev
3537)
@@ -759,6 +759,7 @@
}
ptsTo.clear();
cgNode->unionPointsTo(tmp, pti.qual());
+ tmp.clear();
}
}
@@ -996,7 +997,12 @@
node = notAPointer();
else {
// Do initial value processing for the symbol
- processInitValues(ST_st_idx(base_st));
+ if (ST_is_initialized(*base_st) &&
+ (_processedInitVals.find(ST_st_idx(base_st)) ==
+ _processedInitVals.end())) {
+ processInitValues(ST_st_idx(base_st));
+ _processedInitVals.insert(ST_st_idx(base_st));
+ }
node = getCGNode(CG_ST_st_idx(base_st), base_offset);
}
pts.setBit(node->id());
@@ -1146,10 +1152,15 @@
node = notAPointer();
else {
// Process the init vals of this symbol
+ if (ST_is_initialized(*base_st) &&
+ (_processedInitVals.find(ST_st_idx(base_st)) ==
+ _processedInitVals.end())) {
+ if (Get_Trace(TP_ALIAS,NYSTROM_CG_BUILD_FLAG))
+ fprintf(stderr, "Processing symbol value...\n");
+ processInitValues(ST_st_idx(base_st));
+ _processedInitVals.insert(ST_st_idx(base_st));
+ }
if (Get_Trace(TP_ALIAS,NYSTROM_CG_BUILD_FLAG))
- fprintf(stderr, "Processing symbol value...\n");
- processInitValues(ST_st_idx(base_st));
- if (Get_Trace(TP_ALIAS,NYSTROM_CG_BUILD_FLAG))
fprintf(stderr, "End processing symbol value...\n");
node = getCGNode(CG_ST_st_idx(base_st), base_offset);
}
@@ -1332,8 +1343,11 @@
}
// If the init vals did not have a pointer, ignore any initializations
- if (!foundPtr)
+ if (!foundPtr) {
+ MEM_POOL_Delete(&memPool);
+ tmp.clear();
return;
+ }
ConstraintGraphNode::sanitizePointsTo(tmp,NULL,CQ_NONE);
ConstraintGraphNode *node = getCGNode(CG_ST_st_idx(base_st), base_offset);
@@ -1344,6 +1358,8 @@
node->print(stderr);
fprintf(stderr, "\n");
}
+ MEM_POOL_Delete(&memPool);
+ tmp.clear();
return;
}
Modified: trunk/osprey/be/com/constraint_graph_solve.cxx
===================================================================
--- trunk/osprey/be/com/constraint_graph_solve.cxx 2011-04-06 05:54:02 UTC
(rev 3536)
+++ trunk/osprey/be/com/constraint_graph_solve.cxx 2011-04-06 06:03:01 UTC
(rev 3537)
@@ -333,6 +333,7 @@
}
ptsTo.clear();
rep->unionPointsTo(tmp, pti.qual());
+ tmp.clear();
}
}
}
@@ -1274,6 +1275,7 @@
bool change = dst.setUnion(diff);
+ diff.clear();
return change;
}
@@ -1363,6 +1365,7 @@
printPointsTo(dst);
fprintf(stderr,"\n");
}
+ diff.clear();
Is_True(sanityCheckPointsTo(qual),
("Node %d destination contains <ST,x> and <ST,-1>\n",id()));
@@ -1456,7 +1459,6 @@
}
CGNodeId trackNodeId = 0;
- PointsTo origPts;
UINT32 assignSize = edge->size();
StInfo *dstStInfo = dst->cg()->stInfo(dst->cg_st_idx());
@@ -1559,6 +1561,7 @@
ConstraintGraph::solverModList()->push(dst);
updateOffsets(dst,tmp,dstQual);
}
+ tmp.clear();
}
}
}
------------------------------------------------------------------------------
Xperia(TM) PLAY
It's a major breakthrough. An authentic gaming
smartphone on the nation's most reliable network.
And it wants your games.
http://p.sf.net/sfu/verizon-sfdev
_______________________________________________
Open64-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/open64-devel