Fix GCC version runtime changes, bug651.

This commit is contained in:
Wilson Snyder 2013-05-23 20:19:51 -04:00
parent 3bd3d01968
commit 175d59ecba
9 changed files with 15 additions and 13 deletions

View File

@ -7,6 +7,8 @@ indicates the contributor was also the author of the fix; Thanks!
**** Fix arrayed input compile error, bug645. [Krzysztof Jankowski]
**** Fix GCC version runtime changes, bug651. [Jeremy Bennett]
* Verilator 3.847 2013-05-11

View File

@ -526,7 +526,7 @@ private:
}
}
}
sort(report.begin(), report.end());
stable_sort(report.begin(), report.end());
for (deque<string>::iterator it = report.begin(); it!=report.end(); ++it) {
*ofp << *it;
}

View File

@ -1413,7 +1413,7 @@ private:
for (AstNodeSenItem* senp = nodep->sensesp()->castNodeSenItem(); senp; senp=senp->nextp()->castNodeSenItem()) {
vec.push_back(senp);
}
sort(vec.begin(), vec.end(), SenItemCmp());
stable_sort(vec.begin(), vec.end(), SenItemCmp());
for (vector<AstNodeSenItem*>::iterator it=vec.begin(); it!=vec.end(); ++it) {
(*it)->unlinkFrBack();
}

View File

@ -1717,7 +1717,7 @@ void EmitCImp::emitIntFuncDecls(AstNodeModule* modp) {
}
}
sort(funcsp.begin(), funcsp.end(), CmpName());
stable_sort(funcsp.begin(), funcsp.end(), CmpName());
for (vector<AstCFunc*>::iterator it = funcsp.begin(); it != funcsp.end(); ++it) {
AstCFunc* funcp = *it;

View File

@ -168,8 +168,8 @@ class EmitCSyms : EmitCBaseVisitor {
varsExpand();
// Sort by names, so line/process order matters less
sort(m_scopes.begin(), m_scopes.end(), CmpName());
sort(m_dpis.begin(), m_dpis.end(), CmpDpi());
stable_sort(m_scopes.begin(), m_scopes.end(), CmpName());
stable_sort(m_dpis.begin(), m_dpis.end(), CmpDpi());
// Output
emitSymHdr();

View File

@ -461,7 +461,7 @@ void GraphAcyc::place() {
}
// Sort by weight, then by vertex (so that we completely process one vertex, when possible)
sort(edges.begin(), edges.end(), GraphAcycEdgeCmp());
stable_sort(edges.begin(), edges.end(), GraphAcycEdgeCmp());
// Process each edge in weighted order
m_placeStep = 10;

View File

@ -464,7 +464,7 @@ void V3Graph::sortVertices() {
for (V3GraphVertex* vertexp = verticesBeginp(); vertexp; vertexp=vertexp->verticesNextp()) {
vertices.push_back(vertexp);
}
std::sort(vertices.begin(), vertices.end(), GraphSortVertexCmp());
std::stable_sort(vertices.begin(), vertices.end(), GraphSortVertexCmp());
this->verticesUnlink();
for (vector<V3GraphVertex*>::iterator it = vertices.begin(); it!=vertices.end(); ++it) {
(*it)->verticesPushBack(this);
@ -480,7 +480,7 @@ void V3Graph::sortEdges() {
edges.push_back(edgep);
}
// Sort
std::sort(edges.begin(), edges.end(), GraphSortEdgeCmp());
std::stable_sort(edges.begin(), edges.end(), GraphSortEdgeCmp());
// Relink edges in specified order
// We know the vector contains all of the edges that were

View File

@ -67,7 +67,7 @@ void V3LinkLevel::modSortByLevel() {
}
vec.push_back(nodep);
}
sort(vec.begin(), vec.end(), CmpLevel()); // Sort the vector
stable_sort(vec.begin(), vec.end(), CmpLevel()); // Sort the vector
for (ModVec::iterator it = vec.begin(); it != vec.end(); ++it) {
AstNodeModule* nodep = *it;
nodep->unlinkFrBack();

View File

@ -476,7 +476,7 @@ private:
// elements. Up to 10 of the widest
cerr<<V3Error::msgPrefix()
<<" Widest candidate vars to split:"<<endl;
sort (m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarWidthCmp());
std::stable_sort (m_unoptflatVars.begin(), m_unoptflatVars.end(), OrderVarWidthCmp());
int lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
for (int i = 0; i < lim; i++) {
OrderVarStdVertex* vsvertexp = m_unoptflatVars[i];
@ -489,8 +489,8 @@ private:
// Up to 10 of the most fanned out
cerr<<V3Error::msgPrefix()
<<" Most fanned out candidate vars to split:"<<endl;
sort (m_unoptflatVars.begin(), m_unoptflatVars.end(),
OrderVarFanoutCmp());
std::stable_sort (m_unoptflatVars.begin(), m_unoptflatVars.end(),
OrderVarFanoutCmp());
lim = m_unoptflatVars.size() < 10 ? m_unoptflatVars.size() : 10;
for (int i = 0; i < lim; i++) {
OrderVarStdVertex* vsvertexp = m_unoptflatVars[i];
@ -1324,7 +1324,7 @@ void OrderVisitor::processEdgeReport() {
}
*logp<<"Signals and their clock domains:"<<endl;
sort(report.begin(), report.end());
stable_sort(report.begin(), report.end());
for (deque<string>::iterator it=report.begin(); it!=report.end(); ++it) {
*logp<<(*it)<<endl;
}