- added ir_bk_inner_trampoline: this allows to defer the construction of trampolines
[libfirm] / ir / ana / irmemory.c
index 8503266..db1f94c 100644 (file)
@@ -334,6 +334,8 @@ static ir_alias_relation different_sel_offsets(ir_node *sel1, ir_node *sel2) {
                        return have_no > 0 ? no_alias : sure_alias;
                }
        }
+#else
+       (void) different_index;
 #endif
        return ir_may_alias;
 }  /* different_sel_offsets */
@@ -438,6 +440,8 @@ ir_storage_class_class_t classify_pointer(ir_graph *irg, ir_node *irn, ir_entity
                        res |= ir_sc_modifier_nottaken;
        } else if (is_Proj(irn) && is_malloc_Result(irn)) {
                return ir_sc_malloced;
+       } else if (is_Const(irn)) {
+               return ir_sc_globaladdr;
        }
 
        return res;
@@ -603,6 +607,16 @@ static ir_alias_relation _get_alias_relation(
 
                        /* for some reason CSE didn't happen yet for the 2 SymConsts... */
                        return ir_may_alias;
+               } else if (class1 == ir_sc_globaladdr) {
+                       tarval *tv  = get_Const_tarval(base1);
+                       offset1    += get_tarval_long(tv);
+                       tv          = get_Const_tarval(base2);
+                       offset2    += get_tarval_long(tv);
+
+                       if ((unsigned long)labs(offset2 - offset1) >= mode_size)
+                               return ir_no_alias;
+                       else
+                               return ir_sure_alias;
                }
        }