src/share/vm/opto/node.cpp

Print this page
rev 5823 : 8033215: clang: node.cpp:284 IDX_INIT macro use uninitialized field _out
Reviewed-by:

@@ -283,10 +283,14 @@
 // (Aren't you thankful that Java finals don't require so many tricks?)
 #define IDX_INIT(req) this->Init((req), (Compile*) this->_out)
 #ifdef _MSC_VER // the IDX_INIT hack falls foul of warning C4355
 #pragma warning( disable:4355 ) // 'this' : used in base member initializer list
 #endif
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma GCC diagnostic ignored "-Wuninitialized"
+#endif
 
 // Out-of-line code from node constructors.
 // Executed only when extra debug info. is being passed around.
 static void init_node_notes(Compile* C, int idx, Node_Notes* nn) {
   C->set_node_notes_at(idx, nn);

@@ -466,10 +470,14 @@
   _in[4] = n4; if (n4 != NULL) n4->add_out((Node *)this);
   _in[5] = n5; if (n5 != NULL) n5->add_out((Node *)this);
   _in[6] = n6; if (n6 != NULL) n6->add_out((Node *)this);
 }
 
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
 
 //------------------------------clone------------------------------------------
 // Clone a Node.
 Node *Node::clone() const {
   Compile* C = Compile::current();