Hi, I am trying to implement named address space for our target. In alias.c, I found the following piece of code several times.
/* If we have MEMs refering to different address spaces (which can potentially overlap), we cannot easily tell from the addresses whether the references overlap. */ if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) return 1; I think we can do better with the existing target hook: - Target Hook: bool TARGET_ADDR_SPACE_SUBSET_P (addr_space_t superset, addr_space_t subset) If A is not subset of B and B is not subset of A, we can conclude they are either disjoint or overlapped. According to standard draft (section 3.1.3), "For any two address spaces, either the address spaces must be disjoint, they must be equivalent, or one must be a subset of the other. Other forms of overlapping are not permitted." Therefore, A & B could only be disjoint, i.e., not aliased to each other. We should be able to write: if (MEM_ADDR_SPACE (mem) != MEM_ADDR_SPACE (x)) { if (!targetm.addr_space.subset_p (MEM_ADDR_SPACE (mem), MEM_ADDR_SPACE (x)) && !targetm.addr_space.subset_p (MEM_ADDR_SPACE (x), MEM_ADDR_SPACE (mem))) return 0; else return 1; } Is this correct? Thanks, Bingfeng Mei