summaryrefslogtreecommitdiffstats
path: root/src/aig/ivy
diff options
context:
space:
mode:
authorAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
committerAlan Mishchenko <alanmi@berkeley.edu>2008-07-02 08:01:00 -0700
commit303baf27cf34c2a57db97c4c567fd744241fa14b (patch)
treed6235cca48e7bdfe5884e517058c7791e66bb806 /src/aig/ivy
parentfa67e3c19e27c011517b91182eb3929412aaf402 (diff)
downloadabc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.gz
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.tar.bz2
abc-303baf27cf34c2a57db97c4c567fd744241fa14b.zip
Version abc80702
Diffstat (limited to 'src/aig/ivy')
-rw-r--r--src/aig/ivy/ivyBalance.c2
-rw-r--r--src/aig/ivy/ivyCanon.c2
-rw-r--r--src/aig/ivy/ivyCut.c3
-rw-r--r--src/aig/ivy/ivyDfs.c2
-rw-r--r--src/aig/ivy/ivyFastMap.c40
-rw-r--r--src/aig/ivy/ivyFraig.c13
-rw-r--r--src/aig/ivy/ivyMem.c2
-rw-r--r--src/aig/ivy/ivyMulti.c12
-rw-r--r--src/aig/ivy/ivyRwr.c20
-rw-r--r--src/aig/ivy/ivySeq.c21
-rw-r--r--src/aig/ivy/ivyShow.c2
11 files changed, 65 insertions, 54 deletions
diff --git a/src/aig/ivy/ivyBalance.c b/src/aig/ivy/ivyBalance.c
index e0b2bef2..b5c77e39 100644
--- a/src/aig/ivy/ivyBalance.c
+++ b/src/aig/ivy/ivyBalance.c
@@ -72,7 +72,7 @@ Ivy_Man_t * Ivy_ManBalance( Ivy_Man_t * p, int fUpdateLevel )
Ivy_ObjCreatePo( pNew, Ivy_EdgeToNode(pNew, NewNodeId) );
}
Vec_VecFree( vStore );
- if ( i = Ivy_ManCleanup( pNew ) )
+ if ( (i = Ivy_ManCleanup( pNew )) )
{
// printf( "Cleanup after balancing removed %d dangling nodes.\n", i );
}
diff --git a/src/aig/ivy/ivyCanon.c b/src/aig/ivy/ivyCanon.c
index 5768b87e..db5918de 100644
--- a/src/aig/ivy/ivyCanon.c
+++ b/src/aig/ivy/ivyCanon.c
@@ -53,7 +53,7 @@ Ivy_Obj_t * Ivy_CanonPair_rec( Ivy_Man_t * p, Ivy_Obj_t * pGhost )
// consider the case when the pair is canonical
if ( !Ivy_ObjIsLatch(Ivy_ObjFanin0(pGhost)) || !Ivy_ObjIsLatch(Ivy_ObjFanin1(pGhost)) )
{
- if ( pResult = Ivy_TableLookup( p, pGhost ) )
+ if ( (pResult = Ivy_TableLookup( p, pGhost )) )
return pResult;
return Ivy_ObjCreate( p, pGhost );
}
diff --git a/src/aig/ivy/ivyCut.c b/src/aig/ivy/ivyCut.c
index e257d8a6..b0dd6db7 100644
--- a/src/aig/ivy/ivyCut.c
+++ b/src/aig/ivy/ivyCut.c
@@ -300,7 +300,8 @@ int Ivy_ManFindBoolCutCost( Ivy_Obj_t * pObj )
***********************************************************************/
int Ivy_ManFindBoolCut( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Vec_Ptr_t * vFront, Vec_Ptr_t * vVolume, Vec_Ptr_t * vLeaves )
{
- Ivy_Obj_t * pObj, * pFaninC, * pFanin0, * pFanin1, * pPivot;
+ Ivy_Obj_t * pObj = NULL; // Suppress "might be used uninitialized"
+ Ivy_Obj_t * pFaninC, * pFanin0, * pFanin1, * pPivot;
int RetValue, LevelLimit, Lev, k;
assert( !Ivy_IsComplement(pRoot) );
// clear the frontier and collect the nodes
diff --git a/src/aig/ivy/ivyDfs.c b/src/aig/ivy/ivyDfs.c
index c27cba31..9594c0d2 100644
--- a/src/aig/ivy/ivyDfs.c
+++ b/src/aig/ivy/ivyDfs.c
@@ -382,7 +382,7 @@ int Ivy_ManIsAcyclic( Ivy_Man_t * p )
Ivy_ManForEachCo( p, pObj, i )
{
// traverse the output logic cone
- if ( fAcyclic = Ivy_ManIsAcyclic_rec(p, Ivy_ObjFanin0(pObj)) )
+ if ( (fAcyclic = Ivy_ManIsAcyclic_rec(p, Ivy_ObjFanin0(pObj))) )
continue;
// stop as soon as the first loop is detected
fprintf( stdout, " (cone of %s \"%d\")\n", Ivy_ObjIsLatch(pObj)? "latch" : "PO", Ivy_ObjId(pObj) );
diff --git a/src/aig/ivy/ivyFastMap.c b/src/aig/ivy/ivyFastMap.c
index c4a043f2..6ee177a4 100644
--- a/src/aig/ivy/ivyFastMap.c
+++ b/src/aig/ivy/ivyFastMap.c
@@ -309,7 +309,7 @@ int Ivy_FastMapArea( Ivy_Man_t * pAig )
SeeAlso []
***********************************************************************/
-static inline Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj )
+static inline int Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj )
{
return Ivy_ObjIsNode(pObj) && Ivy_ObjRefs(pObj) == 1;
}
@@ -325,7 +325,7 @@ static inline Ivy_ObjIsNodeInt1( Ivy_Obj_t * pObj )
SeeAlso []
***********************************************************************/
-static inline Ivy_ObjIsNodeInt2( Ivy_Obj_t * pObj )
+static inline int Ivy_ObjIsNodeInt2( Ivy_Obj_t * pObj )
{
return Ivy_ObjIsNode(pObj) && Ivy_ObjRefs(pObj) <= 2;
}
@@ -612,30 +612,30 @@ void Ivy_FastMapNode( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit )
pFaninA = Ivy_ObjFanin0(pFanin0);
pFaninB = Ivy_ObjFanin1(pFanin0);
if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) )
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0);
else
{
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA);
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB);
}
}
else
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0);
// process the second fanin
if ( Ivy_ObjIsNodeInt1(pFanin1) )
{
pFaninA = Ivy_ObjFanin0(pFanin1);
pFaninB = Ivy_ObjFanin1(pFanin1);
if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) )
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1);
else
{
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA);
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB);
}
}
else
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1);
// sort the fanins
Vec_IntSelectSort( pSupp->pArray, pSupp->nSize );
pSupp->nSize = Vec_IntRemoveDup( pSupp->pArray, pSupp->nSize );
@@ -681,30 +681,30 @@ void Ivy_FastMapNode( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit )
pFaninA = Ivy_ObjFanin0(pFanin0);
pFaninB = Ivy_ObjFanin1(pFanin0);
if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) )
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0);
else
{
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA);
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB);
}
}
else
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin0);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin0);
// process the second fanin
if ( Ivy_ObjIsNodeInt1(pFanin1) )
{
pFaninA = Ivy_ObjFanin0(pFanin1);
pFaninB = Ivy_ObjFanin1(pFanin1);
if ( Ivy_ObjIsNodeInt1(pFaninA) && Ivy_ObjIsNodeInt1(pFaninB) )
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1);
else
{
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninA);
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFaninB);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninA);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFaninB);
}
}
else
- pSupp->pArray[pSupp->nSize++] = Ivy_ObjId(pFanin1);
+ pSupp->pArray[(int)(pSupp->nSize++)] = Ivy_ObjId(pFanin1);
// sort the fanins
Vec_IntSelectSort( pSupp->pArray, pSupp->nSize );
pSupp->nSize = Vec_IntRemoveDup( pSupp->pArray, pSupp->nSize );
@@ -1497,10 +1497,6 @@ void Ivy_FastMapNodeRecover( Ivy_Man_t * pAig, Ivy_Obj_t * pObj, int nLimit, Vec
AreaBef = Ivy_FastMapNodeAreaRefed( pAig, pObj );
// if ( AreaBef == 1 )
// return;
- if ( pObj->Id == 102 )
- {
- int x = 0;
- }
// the cut is non-trivial
Ivy_FastMapNodePrepare( pAig, pObj, nLimit, vFront, vFrontOld );
// iteratively modify the cut
diff --git a/src/aig/ivy/ivyFraig.c b/src/aig/ivy/ivyFraig.c
index 0d9d42a3..c306c394 100644
--- a/src/aig/ivy/ivyFraig.c
+++ b/src/aig/ivy/ivyFraig.c
@@ -141,7 +141,7 @@ static inline Ivy_Obj_t * Ivy_ObjNodeHashNext( Ivy_Obj_t * pObj )
static inline Ivy_Obj_t * Ivy_ObjEquivListNext( Ivy_Obj_t * pObj ) { return pObj->pPrevFan0; }
static inline Ivy_Obj_t * Ivy_ObjEquivListPrev( Ivy_Obj_t * pObj ) { return pObj->pPrevFan1; }
static inline Ivy_Obj_t * Ivy_ObjFraig( Ivy_Obj_t * pObj ) { return pObj->pEquiv; }
-static inline int Ivy_ObjSatNum( Ivy_Obj_t * pObj ) { return (int)pObj->pNextFan0; }
+static inline int Ivy_ObjSatNum( Ivy_Obj_t * pObj ) { return (int)(PORT_PTRUINT_T)pObj->pNextFan0; }
static inline Vec_Ptr_t * Ivy_ObjFaninVec( Ivy_Obj_t * pObj ) { return (Vec_Ptr_t *)pObj->pNextFan1; }
static inline void Ivy_ObjSetSim( Ivy_Obj_t * pObj, Ivy_FraigSim_t * pSim ) { pObj->pFanout = (Ivy_Obj_t *)pSim; }
@@ -152,7 +152,7 @@ static inline void Ivy_ObjSetNodeHashNext( Ivy_Obj_t * pObj, Ivy_Obj_t *
static inline void Ivy_ObjSetEquivListNext( Ivy_Obj_t * pObj, Ivy_Obj_t * pNext ) { pObj->pPrevFan0 = pNext; }
static inline void Ivy_ObjSetEquivListPrev( Ivy_Obj_t * pObj, Ivy_Obj_t * pPrev ) { pObj->pPrevFan1 = pPrev; }
static inline void Ivy_ObjSetFraig( Ivy_Obj_t * pObj, Ivy_Obj_t * pNode ) { pObj->pEquiv = pNode; }
-static inline void Ivy_ObjSetSatNum( Ivy_Obj_t * pObj, int Num ) { pObj->pNextFan0 = (Ivy_Obj_t *)Num; }
+static inline void Ivy_ObjSetSatNum( Ivy_Obj_t * pObj, int Num ) { pObj->pNextFan0 = (Ivy_Obj_t *)(PORT_PTRUINT_T)Num; }
static inline void Ivy_ObjSetFaninVec( Ivy_Obj_t * pObj, Vec_Ptr_t * vFanins ) { pObj->pNextFan1 = (Ivy_Obj_t *)vFanins; }
static inline unsigned Ivy_ObjRandomSim() { return (rand() << 24) ^ (rand() << 12) ^ rand(); }
@@ -252,8 +252,8 @@ int Ivy_FraigProve( Ivy_Man_t ** ppManAig, void * pPars )
Prove_Params_t * pParams = pPars;
Ivy_FraigParams_t Params, * pIvyParams = &Params;
Ivy_Man_t * pManAig, * pManTemp;
- int RetValue, nIter, clk, timeStart = clock();//, Counter;
- sint64 nSatConfs, nSatInspects;
+ int RetValue, nIter, clk;//, Counter;
+ sint64 nSatConfs = 0, nSatInspects = 0;
// start the network and parameters
pManAig = *ppManAig;
@@ -2076,7 +2076,7 @@ void Ivy_FraigPrintActivity( Ivy_FraigMan_t * p )
***********************************************************************/
int Ivy_FraigNodesAreEquiv( Ivy_FraigMan_t * p, Ivy_Obj_t * pOld, Ivy_Obj_t * pNew )
{
- int pLits[4], RetValue, RetValue1, nBTLimit, clk, clk2 = clock();
+ int pLits[4], RetValue, RetValue1, nBTLimit, clk; //, clk2 = clock();
// make sure the nodes are not complemented
assert( !Ivy_IsComplement(pNew) );
@@ -2225,7 +2225,8 @@ p->timeSatFail += clock() - clk;
***********************************************************************/
int Ivy_FraigNodeIsConst( Ivy_FraigMan_t * p, Ivy_Obj_t * pNew )
{
- int pLits[2], RetValue1, RetValue, clk;
+ int pLits[2], RetValue1, clk;
+// int RetValue;
// make sure the nodes are not complemented
assert( !Ivy_IsComplement(pNew) );
diff --git a/src/aig/ivy/ivyMem.c b/src/aig/ivy/ivyMem.c
index 2a96857c..fd29e9ae 100644
--- a/src/aig/ivy/ivyMem.c
+++ b/src/aig/ivy/ivyMem.c
@@ -96,7 +96,7 @@ void Ivy_ManAddMemory( Ivy_Man_t * p )
pMemory = ALLOC( char, nBytes );
Vec_PtrPush( p->vChunks, pMemory );
// align memory at the 32-byte boundary
- pMemory = pMemory + EntrySizeMax - (((int)pMemory) & (EntrySizeMax-1));
+ pMemory = pMemory + EntrySizeMax - (((int)(PORT_PTRUINT_T)pMemory) & (EntrySizeMax-1));
// remember the manager in the first entry
Vec_PtrPush( p->vPages, pMemory );
// break the memory down into nodes
diff --git a/src/aig/ivy/ivyMulti.c b/src/aig/ivy/ivyMulti.c
index a7970156..882c2c87 100644
--- a/src/aig/ivy/ivyMulti.c
+++ b/src/aig/ivy/ivyMulti.c
@@ -56,7 +56,8 @@ int Ivy_MultiPlus( Ivy_Man_t * p, Vec_Ptr_t * vLeaves, Vec_Ptr_t * vCone, Ivy_Ty
{
static Ivy_Eva_t pEvals[IVY_EVAL_LIMIT];
Ivy_Eva_t * pEval, * pFan0, * pFan1;
- Ivy_Obj_t * pObj, * pTemp;
+ Ivy_Obj_t * pObj = NULL; // Suppress "might be used uninitialized"
+ Ivy_Obj_t * pTemp;
int nEvals, nEvalsOld, i, k, x, nLeaves;
unsigned uMaskAll;
@@ -218,9 +219,14 @@ static inline int Ivy_MultiWeight( unsigned uMask, int nMaskOnes, unsigned uFoun
int Ivy_MultiCover( Ivy_Man_t * p, Ivy_Eva_t * pEvals, int nLeaves, int nEvals, int nLimit, Vec_Ptr_t * vSols )
{
int fVerbose = 0;
- Ivy_Eva_t * pEval, * pEvalBest;
+ Ivy_Eva_t * pEval;
+ Ivy_Eva_t * pEvalBest = NULL; // Suppress "might be used uninitialized"
unsigned uMaskAll, uFound, uTemp;
- int i, k, BestK, WeightBest, WeightCur, LevelBest, LevelCur;
+ int i, k, BestK;
+ int WeightBest = -1; // Suppress "might be used uninitialized"
+ int WeightCur;
+ int LevelBest = -1; // Suppress "might be used uninitialized"
+ int LevelCur;
uMaskAll = (nLeaves == 32)? (~(unsigned)0) : ((1 << nLeaves) - 1);
uFound = 0;
// solve the covering problem
diff --git a/src/aig/ivy/ivyRwr.c b/src/aig/ivy/ivyRwr.c
index 3f8720ba..8bfeb03c 100644
--- a/src/aig/ivy/ivyRwr.c
+++ b/src/aig/ivy/ivyRwr.c
@@ -81,7 +81,7 @@ int Ivy_ManRewritePre( Ivy_Man_t * p, int fUpdateLevel, int fUseZeroCost, int fV
break;
// for each cut, try to resynthesize it
nGain = Ivy_NodeRewrite( p, pManRwt, pNode, fUpdateLevel, fUseZeroCost );
- if ( nGain > 0 || nGain == 0 && fUseZeroCost )
+ if ( nGain > 0 || (nGain == 0 && fUseZeroCost) )
{
Dec_Graph_t * pGraph = Rwt_ManReadDecs(pManRwt);
int fCompl = Rwt_ManReadCompl(pManRwt);
@@ -122,7 +122,7 @@ Rwt_ManAddTimeTotal( pManRwt, clock() - clkStart );
else
Ivy_ManResetLevels( p );
// check
- if ( i = Ivy_ManCleanup(p) )
+ if ( (i = Ivy_ManCleanup(p)) )
printf( "Cleanup after rewriting removed %d dangling nodes.\n", i );
if ( !Ivy_ManCheck(p) )
printf( "Ivy_ManRewritePre(): The check has failed.\n" );
@@ -154,9 +154,12 @@ int Ivy_NodeRewrite( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int fUp
Ivy_Store_t * pStore;
Ivy_Cut_t * pCut;
Ivy_Obj_t * pFanin;
- unsigned uPhase, uTruthBest, uTruth;
+ unsigned uPhase;
+ unsigned uTruthBest = 0; // Suppress "might be used uninitialized"
+ unsigned uTruth;
char * pPerm;
- int Required, nNodesSaved, nNodesSaveCur;
+ int Required, nNodesSaved;
+ int nNodesSaveCur = -1; // Suppress "might be used uninitialized"
int i, c, GainCur, GainBest = -1;
int clk, clk2;
@@ -190,14 +193,14 @@ clk = clock();
clk2 = clock();
uTruth = 0xFFFF & Ivy_NodeGetTruth( pNode, pCut->pArray, pCut->nSize ); // truth table
p->timeTruth += clock() - clk2;
- pPerm = p->pPerms4[ p->pPerms[uTruth] ];
+ pPerm = p->pPerms4[ (int) p->pPerms[uTruth] ];
uPhase = p->pPhases[uTruth];
// collect fanins with the corresponding permutation/phase
Vec_PtrClear( p->vFaninsCur );
Vec_PtrFill( p->vFaninsCur, (int)pCut->nSize, 0 );
for ( i = 0; i < (int)pCut->nSize; i++ )
{
- pFanin = Ivy_ManObj( pMan, pCut->pArray[pPerm[i]] );
+ pFanin = Ivy_ManObj( pMan, pCut->pArray[(int)pPerm[i]] );
assert( Ivy_ObjIsNode(pFanin) || Ivy_ObjIsCi(pFanin) );
pFanin = Ivy_NotCond(pFanin, ((uPhase & (1<<i)) > 0) );
Vec_PtrWriteEntry( p->vFaninsCur, i, pFanin );
@@ -355,7 +358,8 @@ unsigned Ivy_NodeGetTruth( Ivy_Obj_t * pObj, int * pNums, int nNums )
Dec_Graph_t * Rwt_CutEvaluate( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pRoot, Vec_Ptr_t * vFaninsCur, int nNodesSaved, int LevelMax, int * pGainBest, unsigned uTruth )
{
Vec_Ptr_t * vSubgraphs;
- Dec_Graph_t * pGraphBest, * pGraphCur;
+ Dec_Graph_t * pGraphBest = NULL; // Suppress "might be used uninitialized"
+ Dec_Graph_t * pGraphCur;
Rwt_Node_t * pNode, * pFanin;
int nNodesAdded, GainBest, i, k;
// find the matching class of subgraphs
@@ -478,7 +482,7 @@ int Ivy_GraphToNetworkCount( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Dec_Graph_t * pGr
Ivy_Obj_t * Ivy_GraphToNetwork( Ivy_Man_t * p, Dec_Graph_t * pGraph )
{
Ivy_Obj_t * pAnd0, * pAnd1;
- Dec_Node_t * pNode;
+ Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized"
int i;
// check for constant function
if ( Dec_GraphIsConst(pGraph) )
diff --git a/src/aig/ivy/ivySeq.c b/src/aig/ivy/ivySeq.c
index 0ee29fee..f4585fa2 100644
--- a/src/aig/ivy/ivySeq.c
+++ b/src/aig/ivy/ivySeq.c
@@ -91,7 +91,7 @@ int Ivy_ManRewriteSeq( Ivy_Man_t * p, int fUseZeroCost, int fVerbose )
break;
// for each cut, try to resynthesize it
nGain = Ivy_NodeRewriteSeq( p, pManRwt, pNode, fUseZeroCost );
- if ( nGain > 0 || nGain == 0 && fUseZeroCost )
+ if ( nGain > 0 || (nGain == 0 && fUseZeroCost) )
{
Dec_Graph_t * pGraph = Rwt_ManReadDecs(pManRwt);
int fCompl = Rwt_ManReadCompl(pManRwt);
@@ -147,9 +147,12 @@ int Ivy_NodeRewriteSeq( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pNode, int
Ivy_Cut_t * pCut;
Ivy_Obj_t * pFanin;//, * pFanout;
Vec_Ptr_t * vFanout;
- unsigned uPhase, uTruthBest, uTruth;//, nNewClauses;
+ unsigned uPhase;
+ unsigned uTruthBest = 0; // Suppress "might be used uninitialized"
+ unsigned uTruth;//, nNewClauses;
char * pPerm;
- int nNodesSaved, nNodesSaveCur;
+ int nNodesSaved;
+ int nNodesSaveCur = -1; // Suppress "might be used uninitialized"
int i, c, GainCur, GainBest = -1;
int clk, clk2;//, clk3;
@@ -182,14 +185,14 @@ clk = clock();
clk2 = clock();
uTruth = 0xFFFF & Ivy_CutGetTruth( pMan, pNode, pCut->pArray, pCut->nSize ); // truth table
p->timeTruth += clock() - clk2;
- pPerm = p->pPerms4[ p->pPerms[uTruth] ];
+ pPerm = p->pPerms4[ (int)p->pPerms[uTruth] ];
uPhase = p->pPhases[uTruth];
// collect fanins with the corresponding permutation/phase
Vec_PtrClear( p->vFaninsCur );
Vec_PtrFill( p->vFaninsCur, (int)pCut->nSize, 0 );
for ( i = 0; i < (int)pCut->nSize; i++ )
{
- pFanin = Ivy_ManObj( pMan, Ivy_LeafId( pCut->pArray[pPerm[i]] ) );
+ pFanin = Ivy_ManObj( pMan, Ivy_LeafId( pCut->pArray[(int)pPerm[i]] ) );
assert( Ivy_ObjIsNode(pFanin) || Ivy_ObjIsCi(pFanin) || Ivy_ObjIsConst1(pFanin) );
pFanin = Ivy_NotCond(pFanin, ((uPhase & (1<<i)) > 0) );
Vec_PtrWriteEntry( p->vFaninsCur, i, pFanin );
@@ -305,7 +308,8 @@ p->timeRes += clock() - clk;
Dec_Graph_t * Rwt_CutEvaluateSeq( Ivy_Man_t * pMan, Rwt_Man_t * p, Ivy_Obj_t * pRoot, Ivy_Cut_t * pCut, char * pPerm, Vec_Ptr_t * vFaninsCur, int nNodesSaved, int * pGainBest, unsigned uTruth )
{
Vec_Ptr_t * vSubgraphs;
- Dec_Graph_t * pGraphBest, * pGraphCur;
+ Dec_Graph_t * pGraphBest = NULL; // Suppress "might be used uninitialized"
+ Dec_Graph_t * pGraphCur;
Rwt_Node_t * pNode;
int nNodesAdded, GainBest, i;
// find the matching class of subgraphs
@@ -364,7 +368,7 @@ void Ivy_GraphPrepare( Dec_Graph_t * pGraph, Ivy_Cut_t * pCut, Vec_Ptr_t * vFani
Dec_GraphForEachLeaf( pGraph, pNode, i )
{
pNode->pFunc = Vec_PtrEntry( vFanins, i );
- pNode->nLat2 = Ivy_LeafLat( pCut->pArray[pPerm[i]] );
+ pNode->nLat2 = Ivy_LeafLat( pCut->pArray[(int)pPerm[i]] );
}
// propagate latches through the nodes
Dec_GraphForEachNode( pGraph, pNode, i )
@@ -470,7 +474,7 @@ int Ivy_GraphToNetworkSeqCountSeq( Ivy_Man_t * p, Ivy_Obj_t * pRoot, Dec_Graph_t
Ivy_Obj_t * Ivy_GraphToNetworkSeq( Ivy_Man_t * p, Dec_Graph_t * pGraph )
{
Ivy_Obj_t * pAnd0, * pAnd1;
- Dec_Node_t * pNode;
+ Dec_Node_t * pNode = NULL; // Suppress "might be used uninitialized"
int i, k;
// check for constant function
if ( Dec_GraphIsConst(pGraph) )
@@ -1021,7 +1025,6 @@ Ivy_Store_t * Ivy_CutComputeForNode( Ivy_Man_t * p, Ivy_Obj_t * pObj, int nLeave
{
static Ivy_Store_t CutStore, * pCutStore = &CutStore;
Ivy_Cut_t CutNew, * pCutNew = &CutNew, * pCut;
- Ivy_Man_t * pMan = p;
Ivy_Obj_t * pLeaf;
int i, k, Temp, nLats, iLeaf0, iLeaf1;
diff --git a/src/aig/ivy/ivyShow.c b/src/aig/ivy/ivyShow.c
index cd726e43..4fac2709 100644
--- a/src/aig/ivy/ivyShow.c
+++ b/src/aig/ivy/ivyShow.c
@@ -44,7 +44,7 @@ static void Ivy_WriteDotAig( Ivy_Man_t * pMan, char * pFileName, int fHaig, Vec_
void Ivy_ManShow( Ivy_Man_t * pMan, int fHaig, Vec_Ptr_t * vBold )
{
extern void Abc_ShowFile( char * FileNameDot );
- static Counter = 0;
+ static int Counter = 0;
char FileNameDot[200];
FILE * pFile;
// create the file name