- } else if (is_Sel(adr1)) {
- /* the first address is a Sel */
- ir_node *base1 = find_base_adr(adr1, &ent1);
-
- if (base1 == get_irg_frame(irg)) {
- /* first is a local variable ent1 */
- if (is_Sel(adr2)) {
- /* the second address is a Sel */
- ir_node *base2 = find_base_adr(adr2, &ent2);
-
- if (base1 == base2) {
- /* identical bases: check for different offsets */
- return different_sel_offsets(adr1, adr2);
- } else if (base2 == get_irg_frame(irg)) {
- /* both addresses are local variables and we know
- they are different (R1 a) */
- if (ent1 != ent2)
- return no_alias;
- } else if (base2 == get_irg_tls(irg)) {
- /* the second one is a TLS variable so they are always
- different (R1 d) */
- return no_alias;
- } else if (is_arg_Proj(base2)) {
- /* the second one is an offset from a parameter so they are
- always different (R1 e) */
- return no_alias;
- }
- } else if (is_arg_Proj(adr2)) {
- /* a local variable and a parameter are always different (R1 e) */
- return no_alias;
- }
- } else if (base1 == get_irg_tls(irg)) {
- /* the first is a TLS variable */
- if (is_Sel(adr2)) {
- /* the second address is a Sel */
- ir_node *base2 = find_base_adr(adr2, &ent2);
-
- if (base1 == base2)
- return different_sel_offsets(adr1, adr2);
- else if (base2 == get_irg_frame(irg)) {
- /* the second one is a local variable so they are always
- different (R1 d) */
- return no_alias;
- } else if (base2 == get_irg_tls(irg)) {
- /* both addresses are TLS variables and we know
- they are different (R1 a) */
- if (ent1 != ent2)
- return no_alias;
- }
- }
- } else if (is_arg_Proj(base1)) {
- /* the first one is an offset from a parameter */
- if (is_Sel(adr2)) {
- /* the second address is a Sel */
- ir_node *base2 = find_base_adr(adr2, &ent2);
-
- if (base2 == get_irg_frame(irg)) {
- /* the second one is a local variable so they are always
- different (R1 e) */
- return no_alias;
- }
- }
- } else if (is_global_var(base1)) {
- /* the first one is a global variable */
- ent1 = get_SymConst_entity(base1);
- if (is_Sel(adr2)) {
- /* the second address is a Sel */
- ir_node *base2 = find_base_adr(adr2, &ent2);
-
- if (base1 == base2)
- return different_sel_offsets(adr1, adr2);
- else if (base2 == get_irg_frame(irg)) {
- /* the second one is a local variable so they are always
- different (R1 a) */
- return no_alias;
- } else if (base2 == get_irg_tls(irg)) {
- /* the second one is a TLS variable so they are always
- different (R1 a) */
- return no_alias;
- } else if (is_arg_Proj(base2)) {
- if (get_entity_address_taken(ent1) == ir_address_not_taken) {
- /* The address of the global variable was never taken, so
- the pointer cannot match (R2). */
- return no_alias;
- }
- } else if (is_global_var(base2)) {
- ent2 = get_SymConst_entity(base2);
- /* both addresses are global variables and we know
- they are different (R1 a) */
- if (ent1 != ent2)
- return no_alias;
- }
- }