Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix incorrect removal of self-assignments (#1357)
## Summary Fix a bug with the MIR-based alias analysis that caused assignments like `arr[x][1] = arr[y][1]` to be considered self-assignments and therefore removed. ## Details Change `comparePaths` to not regress the 'overlap' state from `maybe` back to `yes` when the compared array indices are the same, which led to expressions of the same shape where the outermost array access uses the same static index to being treated as referring to the same location (even when they don't). `injectdestructors` uses the `aliasanalysis` results to remove self- assignments, causing the erroneous removal of assignments. All other uses of `aliasanalysis` are for disabling optimizations, so observable behaviour was not affected there. --------- Co-authored-by: Saem Ghani <[email protected]>
- Loading branch information