stabilize store merging
authorAlexandre Oliva <aoliva@redhat.com>
Thu, 16 Mar 2017 23:31:01 +0000 (23:31 +0000)
committerAlexandre Oliva <aoliva@gcc.gnu.org>
Thu, 16 Mar 2017 23:31:01 +0000 (23:31 +0000)
commit50b6d6761b1a265ced9c471a81da6b91d8b1931a
tree7905059192c02cdbcd9b49414ebc7f6cc04d07ae
parent2e92d7ada96c875356c56ebc336f9b0def0041e2
stabilize store merging

Don't let pointer randomization change the order in which we process
store chains.  This may cause SSA_NAMEs to be released in different
order, and if they're reused later, they may cause differences in SSA
partitioning, leading to differences in expand, and ultimately to
different code.

bootstrap-debug-lean (-fcompare-debug) on i686-linux-gnu has failed in
haifa-sched.c since r245196 exposed the latent ordering problem in
store merging.  In this case, the IR differences (different SSA names
selected for copies in out-of-SSA, resulting in some off-by-one
differences in pseudos) were not significant enough to be visible in
the compiler output.

for  gcc/ChangeLog

* gimple-ssa-store-merging.c (struct imm_store_chain_info):
Add linked-list forward and backlinks.  Insert on
construction, remove on destruction.
(class pass_store_merging): Add m_stores_head field.
(pass_store_merging::terminate_and_process_all_chains):
Iterate over m_stores_head list.
(pass_store_merging::terminate_all_aliasing_chains):
Likewise.
(pass_store_merging::execute): Check for debug stmts first.
Push new chains onto the m_stores_head stack.

From-SVN: r246213
gcc/ChangeLog
gcc/gimple-ssa-store-merging.c