Commit 0c8c685a authored by Michael Beck's avatar Michael Beck
Browse files

- BugFix: fixed wrong usage of classify_pointer()

[r25405]
parent bbcec654
......@@ -69,6 +69,9 @@ typedef enum {
ir_sc_modifier_nottaken = 0x80 /**< if set, the address of the variable was not taken */
} ir_storage_class_class_t;
/** Get the base storage class (ignore modifier) */
#define GET_BASE_SC(x) ((x) & ~ir_sc_modifier_nottaken)
/**
* A source language specific memory disambiguator function.
* Called by get_alias_relation().
......
......@@ -487,7 +487,7 @@ static ir_alias_relation _get_alias_relation(
ir_node *orig_adr1 = adr1;
ir_node *orig_adr2 = adr2;
unsigned mode_size;
ir_storage_class_class_t class1, class2;
ir_storage_class_class_t class1, class2, mod1, mod2;
int have_const_offsets;
if (! get_opt_alias_analysis())
......@@ -581,16 +581,19 @@ static ir_alias_relation _get_alias_relation(
return different_sel_offsets(adr1, adr2);
}
class1 = classify_pointer(irg, base1, ent1);
class2 = classify_pointer(irg, base2, ent2);
mod1 = classify_pointer(irg, base1, ent1);
mod2 = classify_pointer(irg, base2, ent2);
class1 = GET_BASE_SC(mod1);
class2 = GET_BASE_SC(mod2);
if (class1 == ir_sc_pointer) {
if (class2 & ir_sc_modifier_nottaken) {
if (mod2 & ir_sc_modifier_nottaken) {
/* a pointer and an object whose objects was never taken */
return ir_no_alias;
}
} else if (class2 == ir_sc_pointer) {
if (class1 & ir_sc_modifier_nottaken) {
if (mod1 & ir_sc_modifier_nottaken) {
/* a pointer and an object whose objects was never taken */
return ir_no_alias;
}
......
......@@ -313,7 +313,7 @@ static void check_ptr(ir_node *ptr, wlk_env *env) {
/* still alias free */
ptr = find_base_adr(ptr, &ent);
sc = classify_pointer(current_ir_graph, ptr, ent);
sc = GET_BASE_SC(classify_pointer(current_ir_graph, ptr, ent));
if (sc != ir_sc_localvar && sc != ir_sc_malloced) {
/* non-local memory access */
env->only_local_mem = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment