end block can not be optimized away any more.
[libfirm] / ir / ir / irgmod.c
index 4959291..95d00f6 100644 (file)
@@ -1,3 +1,4 @@
+
 /* Copyright (C) 1998 - 2000 by Universitaet Karlsruhe
 ** All rights reserved.
 **
@@ -6,6 +7,12 @@
 ** irgmod: ir graph modification
 */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+# include "irnode_t.h"
+# include "irgraph_t.h"
 # include "irgmod.h"
 # include "array.h"
 
@@ -21,9 +28,10 @@ turn_into_tuple (ir_node *node, int arity)
   if (get_irn_arity(node) == arity) {
     /* keep old array */
   } else {
-    /* allocate new array, remove old one. */
-    /* !!!??? free old in_array */
+    /* Allocate new array, don't free old in_array, it's on the obstack. */
+    ir_node *block = get_nodes_Block(node);
     node->in = NEW_ARR_D (ir_node *, current_ir_graph->obst, arity+1);
+    set_nodes_Block(node, block);
   }
 }