harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ibere...@apache.org
Subject svn commit: r690602 - in /harmony/enhanced/drlvm/trunk/vm/jitrino/src: codegenerator/ia32/ jet/ optimizer/ optimizer/abcd/ shared/
Date Sat, 30 Aug 2008 22:55:38 GMT
Author: iberezhn
Date: Sat Aug 30 15:55:37 2008
New Revision: 690602

URL: http://svn.apache.org/viewvc?rev=690602&view=rev
Log:
Fixed warnings appeared on GCC 4.3.1 (openSUSE 11.0) and treated as errors
(mostly 'suggest parentheses around && within ||', and few other errors
like missing parentheses around condition in conditional operator and
using const values as non-const)


Modified:
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/stats.h
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Loop.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/loop_unroll.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/BitSet.cpp
    harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Stl.h

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32GCSafePoints.cpp Sat
Aug 30 15:55:37 2008
@@ -179,10 +179,10 @@
             }
             U_32 objOps  = 0;
             for (Inst* inst = (Inst*)node->getLastInst(); inst!=NULL; inst = inst->getPrevInst())
{
-                if (inst->getOpndCount() == 0 && ((inst->getKind() == Inst::Kind_MethodEndPseudoInst)

-                        || (inst->getKind() == Inst::Kind_MethodEntryPseudoInst))
-                        || (inst->getMnemonic() == Mnemonic_NOP 
-                        || inst->getKind() == Inst::Kind_EmptyPseudoInst) ) 
+                if ( (inst->getOpndCount() == 0 && ((inst->getKind() == Inst::Kind_MethodEndPseudoInst)

+                        || (inst->getKind() == Inst::Kind_MethodEntryPseudoInst)))
+                     || (inst->getMnemonic() == Mnemonic_NOP
+                        || inst->getKind() == Inst::Kind_EmptyPseudoInst) )
                 {
                     continue; 
                 }

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32IRManager.cpp Sat Aug
30 15:55:37 2008
@@ -1169,9 +1169,9 @@
                     if (/*sourceSize == OpndSize_32 && */sourceOpnd->getType()->isInteger()

                         //&& targetOpnd->getType()->isInteger()
 #ifdef _EM64T_
-                        || sourceSize == OpndSize_64 
-                        && sourceOpnd->getType()->isObject() 
-                        && targetOpnd->getType()->isCompressedReference() 
+                        || ( sourceSize == OpndSize_64 
+                             && sourceOpnd->getType()->isObject() 
+                             && targetOpnd->getType()->isCompressedReference()
)
                         //TODO verify if types match exactly?
 #endif
                         ) {
@@ -2225,7 +2225,7 @@
     Node* unwind = fg->getUnwindNode();
     Node* exit = fg->getExitNode();
     assert(exit!=NULL);
-    assert(unwind == NULL || unwind->getOutDegree() == 1 && unwind->isConnectedTo(true,
exit));
+    assert(unwind == NULL || (unwind->getOutDegree() == 1 && unwind->isConnectedTo(true,
exit)));
     const Edges& exitInEdges = exit->getInEdges();
     for (Edges::const_iterator ite = exitInEdges.begin(), ende = exitInEdges.end(); ite!=ende;
++ite) {
         Edge* edge = *ite;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp
(original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32InternalProfiler.cpp
Sat Aug 30 15:55:37 2008
@@ -18,6 +18,7 @@
  * @author Nikolay A. Sidelnikov
  * @version $Revision: 1.2.12.3.4.3 $
  */
+#include <cstring>
 #include "Ia32IRManager.h"
 
 namespace Jitrino

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/codegenerator/ia32/Ia32PeepHole.cpp Sat Aug
30 15:55:37 2008
@@ -900,7 +900,7 @@
                 isImm(movopnd2) && movopnd2->getImmValue() == 0 &&
                 movopnd1->getId() == cmpopnd1->getId() &&
                 //case CMP:
-                (next->getMnemonic() != Mnemonic_CMP || isImm(cmpopnd2) && cmpopnd2->getImmValue()
== 0) &&
+                (next->getMnemonic() != Mnemonic_CMP || (isImm(cmpopnd2) && cmpopnd2->getImmValue()
== 0)) &&
                 //case TEST:
                 (next->getMnemonic() != Mnemonic_TEST || cmpopnd1->getId() == cmpopnd2->getId())
                 )

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/compiler.cpp Sat Aug 30 15:55:37 2008
@@ -495,7 +495,7 @@
     
     STATS_MEASURE_MIN_MAX_VALUE(code_size, total_code_size, meth_fname());
     STATS_MEASURE_MIN_MAX_VALUE(native_per_bc_ratio, 
-                                m_infoBlock.get_bc_size() == 0 ? 
+                                (m_infoBlock.get_bc_size() == 0) ? 
                                 0 : total_code_size/m_infoBlock.get_bc_size(),
                                 meth_fname());
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/stats.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/stats.h?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/stats.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/jet/stats.h Sat Aug 30 15:55:37 2008
@@ -132,10 +132,10 @@
     #define STATS_MEASURE_MIN_MAX_VALUE( what, value, nam ) \
     { \
         if ( (NULL == Stats::g_name_filter) || (NULL != strstr(meth_fname(), Stats::g_name_filter))
) { \
-        Stats::what##_total += value; \
-        if( Stats::what##_max < value ) { Stats::what##_max = value; Stats::what##_max_name
= nam; }; \
+        Stats::what##_total += (value); \
+        if( Stats::what##_max < (value) ) { Stats::what##_max = (value); Stats::what##_max_name
= nam; }; \
         static bool what##_done = false; \
-        if( !what##_done && Stats::what##_min > value ) { what##_done = true;
Stats::what##_min = value; Stats::what##_min_name = nam; }; \
+        if( !what##_done && Stats::what##_min > (value) ) { what##_done = true;
Stats::what##_min = (value); Stats::what##_min_name = nam; }; \
         }\
     }
 #else   // JIT_STATS

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Inst.cpp Sat Aug 30 15:55:37 2008
@@ -166,9 +166,9 @@
     for(Edges::const_iterator eiter = edges.begin(); eiter != edges.end(); ++eiter) {
         edge = *eiter;
         Node * tar = edge->getTargetNode();
-        if (!tar->isDispatchNode() &&
-            ((result == 0) && (tar->getFirstInst() != targetLabel)) ||
-            ((result == 1) && (tar->getFirstInst() == targetLabel)) ) {
+        if ( (!tar->isDispatchNode() &&
+              ((result == 0) && (tar->getFirstInst() != targetLabel))) ||
+             ((result == 1) && (tar->getFirstInst() == targetLabel)) ) {
             break;
         }
     }
@@ -1805,7 +1805,7 @@
 
 Inst* InstFactory::makeConvUnmanaged(Modifier mod, Type::Tag toType, Opnd* dst, Opnd* src)
{
     assert ((dst->getType()->isUnmanagedPtr() && (src->getType()->isObject()
|| src->getType()->isManagedPtr()))
-        || ((dst->getType()->isObject() || dst->getType()->isManagedPtr())) &&
src->getType()->isUnmanagedPtr()); 
+        || (((dst->getType()->isObject() || dst->getType()->isManagedPtr()))
&& src->getType()->isUnmanagedPtr())); 
     return makeInst(Op_ConvUnmanaged, mod, toType, dst, src);
 }
 

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Loop.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Loop.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Loop.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/Loop.cpp Sat Aug 30 15:55:37 2008
@@ -629,8 +629,8 @@
                 Opnd* unhandledGlobal = NULL;
                 bool hasExit = exit != NULL;
                 bool exitIsUnwind = hasExit && (exit == fg.getUnwindNode());
-                bool exitIsNotDominated = !hasExit || dom.hasDomInfo(header) && dom.hasDomInfo(exit)
-                    && !dom.dominates(header, exit);
+                bool exitIsNotDominated = !hasExit ||
+                    (dom.hasDomInfo(header) && dom.hasDomInfo(exit) && !dom.dominates(header,
exit));
                 StlVector<Inst*>::iterator iiter;
                 for(iiter = variantInsts.begin(); iiter != variantInsts.end(); ++iiter) {
                     Inst* inst = *iiter;

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/abcd/abcd.cpp Sat Aug 30 15:55:37
2008
@@ -599,7 +599,8 @@
     tauPhiInst->insertBefore(derefVarInst);
     Inst *tauLdVarInst = instFactory.makeLdVar(tauResOpnd, tauPhiDstOpnd);
     Inst *ldVarLoc = tauPhiInst->getNextInst();
-    while (ldVarLoc!=NULL && (ldVarLoc->getOpcode() == Op_Phi) || (ldVarLoc->getOpcode()
== Op_TauPi)) {
+    while ( (ldVarLoc!=NULL && (ldVarLoc->getOpcode() == Op_Phi)) ||
+            (ldVarLoc->getOpcode() == Op_TauPi) ) {
         ldVarLoc = ldVarLoc->getNextInst();
     }
     if (Log::isEnabled()) {

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/loop_unroll.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/loop_unroll.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/loop_unroll.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/loop_unroll.cpp Sat Aug 30 15:55:37
2008
@@ -373,8 +373,8 @@
             log_ident(defStack.size());
             Log::out()<<"PHI(";info1.print(Log::out());Log::out()<<",";info2.print(Log::out());Log::out()<<")"<<std::endl;
         }
-        if ((info1.isCounter() && !info1.isPhiSplit()) && (info2.isDOL()
|| info2.isLDConst())
-            || (info2.isCounter() && !info2.isPhiSplit()) && (info1.isDOL()
|| info1.isLDConst()))
+        if ( ((info1.isCounter() && !info1.isPhiSplit()) && (info2.isDOL()
|| info2.isLDConst()))
+             || ((info2.isCounter() && !info2.isPhiSplit()) && (info1.isDOL()
|| info1.isLDConst())) )
         {
             result.setType(OpndLoopInfo::COUNTER);
             result.setIncrement(info1.isCounter() ? info1.getIncrement() : info2.getIncrement());

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/optimizer/osr.cpp Sat Aug 30 15:55:37 2008
@@ -114,11 +114,10 @@
         if (defInst->getNumSrcOperands() > 1) {
             OSROpndInfo info2 =
                 processOpnd(tree, loopHead, defStack, defInst->getSrc(1));
-            if ((info1.isCounter() && !info1.isPhiSplit())
-                && (info2.isDOL() || info2.isLDConst())
-                || (info2.isCounter()
-                    && !info2.isPhiSplit())
-                && (info1.isDOL() || info1.isLDConst())) {
+            if ( ((info1.isCounter() && !info1.isPhiSplit())
+                   && (info2.isDOL() || info2.isLDConst()))
+                 || ((info2.isCounter() && !info2.isPhiSplit())
+                   && (info1.isDOL() || info1.isLDConst())) ) {
 
                 result.setType(OSROpndInfo::COUNTER);
                 result.setIncrement(info1.isCounter()? info1.

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/BitSet.cpp
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/BitSet.cpp?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/BitSet.cpp (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/BitSet.cpp Sat Aug 30 15:55:37 2008
@@ -198,7 +198,7 @@
 //  Sets 32 bits to values indicated by a bit mask and returns old values
 //
 U_32 BitSet::set32Bits(U_32 firstBitNumber, U_32 value) {
-    assert(words != 0 && firstBitNumber < setSize || firstBitNumber % 32 == 0);
+    assert((words != 0 && firstBitNumber < setSize) || firstBitNumber % 32 ==
0);
     U_32 wordIndex = getWordIndex(firstBitNumber);
     U_32 oldValue = words[wordIndex];
     words[wordIndex] = value;
@@ -208,7 +208,7 @@
 //  Returns values of 32 bits encoded as a bit mask
 //
 U_32 BitSet::get32Bits(U_32 firstBitNumber) {
-    assert(words != 0 && firstBitNumber < setSize || firstBitNumber % 32 == 0);
+    assert((words != 0 && firstBitNumber < setSize) || firstBitNumber % 32 ==
0);
     return words[getWordIndex(firstBitNumber)];
 }
 //

Modified: harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Stl.h
URL: http://svn.apache.org/viewvc/harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Stl.h?rev=690602&r1=690601&r2=690602&view=diff
==============================================================================
--- harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Stl.h (original)
+++ harmony/enhanced/drlvm/trunk/vm/jitrino/src/shared/Stl.h Sat Aug 30 15:55:37 2008
@@ -130,9 +130,9 @@
 
   // Allocator equality tests
   template <class U>
-  bool operator==(const StlMMAllocator<U>& allocator) { return pmm == allocator.pmm;
}
+  bool operator==(const StlMMAllocator<U>& allocator) const { return pmm == allocator.pmm;
}
   template <class U>
-  bool operator!=(const StlMMAllocator<U>& allocator) { return pmm != allocator.pmm;
}
+  bool operator!=(const StlMMAllocator<U>& allocator) const { return pmm != allocator.pmm;
}
 
   // Type conversion utility to obtain StlMMAllocator for different underlying type.
   template <class U> struct rebind { typedef StlMMAllocator<U> other; };



Mime
View raw message