aboutsummaryrefslogtreecommitdiff
path: root/gcc/hwint.h
diff options
context:
space:
mode:
authorRichard Sandiford <richard.sandiford@arm.com>2021-01-19 17:50:53 +0000
committerRichard Sandiford <richard.sandiford@arm.com>2021-01-19 17:50:53 +0000
commit6a2a38620cf178b53b217051f32d1d7bbba86fc9 (patch)
tree2bd3bc8988bd0ce2bc3a55deddc8ddae7412a7cb /gcc/hwint.h
parent04cdb132020733bedc36d14d61cce4246b8bbe4c (diff)
downloadgcc-6a2a38620cf178b53b217051f32d1d7bbba86fc9.zip
gcc-6a2a38620cf178b53b217051f32d1d7bbba86fc9.tar.gz
gcc-6a2a38620cf178b53b217051f32d1d7bbba86fc9.tar.bz2
alias: Fix offset checks involving section anchors [PR92294]
memrefs_conflict_p assumes that: [XB + XO, XB + XO + XS) does not alias [YB + YO, YB + YO + YS) whenever: [XO, XO + XS) does not intersect [YO, YO + YS) In other words, the accesses can alias only if XB == YB at runtime. However, this doesn't cope correctly with section anchors. For example, if XB is an anchor symbol and YB is at offset XO from the anchor, then: [XB + XO, XB + XO + XS) overlaps [YB, YB + YS) whatever the value of XO is. In other words, when doing the alias check for two symbols whose local definitions are in the same block, we should apply the known difference between their block offsets to the intersection test above. gcc/ PR rtl-optimization/92294 * alias.c (compare_base_symbol_refs): Take an extra parameter and add the distance between two symbols to it. Enshrine in comments that -1 means "either 0 or 1, but we can't tell which at compile time". (memrefs_conflict_p): Update call accordingly. (rtx_equal_for_memref_p): Likewise. Take the distance between symbols into account.
Diffstat (limited to 'gcc/hwint.h')
0 files changed, 0 insertions, 0 deletions