indentation fixed
[libfirm] / ir / ir / iropt.c
index cf8bc86..9b7c1d4 100644 (file)
@@ -2269,7 +2269,7 @@ static ir_node *transform_node_Mod(ir_node *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 */
@@ -3891,12 +3891,19 @@ static int node_cmp_attr_Load(ir_node *a, ir_node *b) {
            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);