From cbb3351d97f9f27f4d4e0338171b3c8c55f3c9ca Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Thu, 23 Apr 2009 09:16:25 -0400 Subject: [PATCH] Fix GCC 4.3.2 compile warnings. --- Changes | 2 ++ configure.ac | 2 +- include/verilated.h | 20 ++++++++++---------- src/V3Const.cpp | 2 +- src/V3Inline.cpp | 8 ++++---- src/V3Number.cpp | 8 ++++---- src/V3Stats.h | 2 +- 7 files changed, 23 insertions(+), 21 deletions(-) diff --git a/Changes b/Changes index fc12248d4..a26f3be44 100644 --- a/Changes +++ b/Changes @@ -9,6 +9,8 @@ indicates the contributor was also the author of the fix; Thanks! **** Fix "cloning" error with -y/--top-module, bug76. [Dimitris Nalbantis] +**** Fix GCC 4.3.2 compile warnings. + * Verilator 3.702 2009/03/28 *** Add --pins-bv option to use sc_bv for all ports. [Brian Small] diff --git a/configure.ac b/configure.ac index 4382428d1..948e014f2 100644 --- a/configure.ac +++ b/configure.ac @@ -72,5 +72,5 @@ AC_SUBST(pkgdatadir) AC_OUTPUT(Makefile src/Makefile src/Makefile_obj include/verilated.mk) AC_MSG_RESULT([]) -AC_MSG_RESULT([Now type 'make']) +AC_MSG_RESULT([Now type 'gmake']) AC_MSG_RESULT([]) diff --git a/include/verilated.h b/include/verilated.h index 9612cd780..6cd2de527 100644 --- a/include/verilated.h +++ b/include/verilated.h @@ -336,8 +336,8 @@ static inline void VL_ASSIGNBIT_QI(int, int bit, QData& lhsr, QData rhs) { } static inline void VL_ASSIGNBIT_WI(int, int bit, WDataOutP owp, IData rhs) { IData orig = owp[VL_BITWORD_I(bit)]; - owp[VL_BITWORD_I(bit)] = (orig & ~(VL_UL(1)<>nbitsonright; - IData od = d & ~linsmask | owp[oword] & linsmask; - if (oword==hword) owp[oword] = owp[oword] & ~hinsmask | od & hinsmask; + IData od = (d & ~linsmask) | (owp[oword] & linsmask); + if (oword==hword) owp[oword] = (owp[oword] & ~hinsmask) | (od & hinsmask); else owp[oword] = od; } } @@ -1188,12 +1188,12 @@ static inline IData VL_SHIFTRS_III(int obits, int, int, IData lhs, IData rhs) { // Note the C standard does not specify the >> operator as a arithmetic shift! IData sign = -(lhs >> (obits-1)); // ffff_ffff if negative IData signext = ~(VL_MASK_I(obits) >> rhs); // One with bits where we've shifted "past" - return (lhs >> rhs) | sign & VL_CLEAN_II(obits,obits,signext); + return (lhs >> rhs) | (sign & VL_CLEAN_II(obits,obits,signext)); } static inline QData VL_SHIFTRS_QQI(int obits, int, int, QData lhs, IData rhs) { QData sign = -(lhs >> (obits-1)); QData signext = ~(VL_MASK_Q(obits) >> rhs); - return (lhs >> rhs) | sign & VL_CLEAN_QQ(obits,obits,signext); + return (lhs >> rhs) | (sign & VL_CLEAN_QQ(obits,obits,signext)); } static inline WDataOutP VL_SHIFTRS_WWI(int obits,int,int,WDataOutP owp,WDataInP lwp, IData rd) { int word_shift = VL_BITWORD_I(rd); diff --git a/src/V3Const.cpp b/src/V3Const.cpp index ee7b6f2e7..a3a8d56fe 100644 --- a/src/V3Const.cpp +++ b/src/V3Const.cpp @@ -1225,7 +1225,7 @@ private: AstSenItem* litemp = senp->castSenItem(); AstSenItem* ritemp = cmpp->castSenItem(); if (litemp && ritemp) { - if (litemp->varrefp() && ritemp->varrefp() && litemp->varrefp()->sameTree(ritemp->varrefp()) + if ((litemp->varrefp() && ritemp->varrefp() && litemp->varrefp()->sameTree(ritemp->varrefp())) || (!litemp->varrefp() && !ritemp->varrefp())) { // We've sorted in the order ANY, BOTH, POS, NEG, so we don't need to try opposite orders if (( litemp->edgeType()==AstEdgeType::ANYEDGE) // ANY or {BOTH|POS|NEG} -> ANY diff --git a/src/V3Inline.cpp b/src/V3Inline.cpp index f7c19f215..5e9850c3e 100644 --- a/src/V3Inline.cpp +++ b/src/V3Inline.cpp @@ -319,10 +319,10 @@ private: int refs = nodep->user3(); // Should we automatically inline this module? // inlineMult = 2000 by default. If a mod*#instances is < this # nodes, can inline it - bool doit = (userinline || allowed && (refs==1 - || m_stmtCnt < INLINE_MODS_SMALLER - || v3Global.opt.inlineMult() < 1 - || refs*m_stmtCnt < v3Global.opt.inlineMult())); + bool doit = (userinline || (allowed && (refs==1 + || m_stmtCnt < INLINE_MODS_SMALLER + || v3Global.opt.inlineMult() < 1 + || refs*m_stmtCnt < v3Global.opt.inlineMult()))); UINFO(4, " Inline="<