added assertion if reassociation() is called with nodes floating, we need precise...
authorMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 30 Jun 2005 09:55:03 +0000 (09:55 +0000)
committerMichael Beck <beck@ipd.info.uni-karlsruhe.de>
Thu, 30 Jun 2005 09:55:03 +0000 (09:55 +0000)
to detect loop-invariant code

fixed typos

[r6150]

ir/opt/reassoc.c

index 79d6015..b7cfe70 100644 (file)
@@ -56,9 +56,10 @@ static const_class_t get_const_class(ir_node *n, ir_node *block)
     return REAL_CONSTANT;
   if (op == op_SymConst)
     return CONST_EXPR;
+
   /*
    * Beware: Bad nodes are always loop-invariant, but
-   * cannot handles in later code, so filter them here
+   * cannot handled in later code, so filter them here
    */
   if (! is_Bad(n) && is_loop_invariant(n, block))
     return CONST_EXPR;
@@ -328,7 +329,7 @@ static void do_reassociation(ir_node *n, void *env)
 
   hook_reassociate(1);
 
-  /* Reassociation must run until a fixpoint is reached. */
+  /* reassociation must run until a fixpoint is reached. */
   do {
     ir_op   *op    = get_irn_op(n);
     ir_mode *mode  = get_irn_mode(n);
@@ -355,6 +356,8 @@ void optimize_reassociation(ir_graph *irg)
   irg_loopinfo_state state;
 
   assert(get_irg_phase_state(irg) != phase_building);
+  assert(get_irg_pinned(irg) != op_pin_state_floats &&
+    "Reassociation needs pinned graph to work properly");
 
   /* reassociation needs constant folding */
   if (!get_opt_reassociation() || !get_opt_constant_folding())