projects
/
libfirm
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
renamed new_type_pointer_mode() into new_type_pointer()
[libfirm]
/
ir
/
opt
/
reassoc.c
diff --git
a/ir/opt/reassoc.c
b/ir/opt/reassoc.c
index
8f12a13
..
b7cfe70
100644
(file)
--- a/
ir/opt/reassoc.c
+++ b/
ir/opt/reassoc.c
@@
-56,7
+56,12
@@
static const_class_t get_const_class(ir_node *n, ir_node *block)
return REAL_CONSTANT;
if (op == op_SymConst)
return CONST_EXPR;
return REAL_CONSTANT;
if (op == op_SymConst)
return CONST_EXPR;
- if (is_loop_invariant(n, block))
+
+ /*
+ * Beware: Bad nodes are always loop-invariant, but
+ * cannot handled in later code, so filter them here
+ */
+ if (! is_Bad(n) && is_loop_invariant(n, block))
return CONST_EXPR;
return NO_CONSTANT;
return CONST_EXPR;
return NO_CONSTANT;
@@
-324,7
+329,7
@@
static void do_reassociation(ir_node *n, void *env)
hook_reassociate(1);
hook_reassociate(1);
- /*
R
eassociation must run until a fixpoint is reached. */
+ /*
r
eassociation must run until a fixpoint is reached. */
do {
ir_op *op = get_irn_op(n);
ir_mode *mode = get_irn_mode(n);
do {
ir_op *op = get_irn_op(n);
ir_mode *mode = get_irn_mode(n);
@@
-351,6
+356,8
@@
void optimize_reassociation(ir_graph *irg)
irg_loopinfo_state state;
assert(get_irg_phase_state(irg) != phase_building);
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())
/* reassociation needs constant folding */
if (!get_opt_reassociation() || !get_opt_constant_folding())