Skip to content
Snippets Groups Projects
Commit 0f0027d1 authored by Kyrylo Tkachov's avatar Kyrylo Tkachov Committed by Kyrylo Tkachov
Browse files

[store-merging] Use store order as tie-breaker in sort_by_bitpos

As Alexander pointed out in the thread starting at [1] the sort_by_bitpos sorting function
was behaving badly when we had multiple stores at the same position.  He fixed that (thanks!)
but we can do better by not returning zero when the bitpositions are equal but by falling back
to comparing the order the stores appear in, which is guaranteed to be unique (barring other
bugs elsewhere).

This patch does that.

Bootstrapped and tested on aarch64-none-linux-gnu.

[1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00895.html 

	* gimple-ssa-store-merging.c (sort_by_bitpos): Compare store order
	when bitposition is the same.

From-SVN: r252084
parent 7dbe3736
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment