DBG_OPT_CSTEVAL(n, value);
} else {
- ir_node *a = get_Div_left(n);
- ir_node *b = get_Div_right(n);
+ ir_node *a = get_Mod_left(n);
+ ir_node *b = get_Mod_right(n);
ir_node *dummy;
- ir_mode *mode = get_irn_mode(n);
+ ir_mode *mode = get_Mod_resmode(n);
if (a == b && value_not_zero(a, &dummy)) {
/* BEWARE: we can optimize a%a to 0 only if this cannot cause a exception */
get_Load_volatility(b) == volatility_is_volatile)
/* NEVER do CSE on volatile Loads */
return 1;
+ /* do not CSE Loads with different alignment. Be conservative. */
+ if (get_Load_align(a) != get_Load_align(b))
+ return 1;
return get_Load_mode(a) != get_Load_mode(b);
} /* node_cmp_attr_Load */
/** Compares the attributes of two Store nodes. */
static int node_cmp_attr_Store(ir_node *a, ir_node *b) {
+ /* do not CSE Stores with different alignment. Be conservative. */
+ if (get_Store_align(a) != get_Store_align(b))
+ return 1;
+
/* NEVER do CSE on volatile Stores */
return (get_Store_volatility(a) == volatility_is_volatile ||
get_Store_volatility(b) == volatility_is_volatile);