On 10.04.2018 14:09, Alexander Monakov wrote:
Hi,
The add_branch_dependencies function is fairly unusual in that it creates
dependence edges "out of thin air" for all sorts of instructions preceding
BB end. I think that is really unfortunate (explicit barriers in RTL would
be more natural), but I've already complained about that in the PR.
The bug/regression is that this function was not run for sel-sched, but the
testcase uncovers that moving a USE away from the return insn can break
assumptions in mode-switching code.
Solve this by running the first part of add_branch_dependencies where it
sets CANT_MOVE flags on immovable non-branch insns.
Bootstrapped/regtested on x86_64 with sel-sched active. OK to apply?
Looks fine to me but I cannot approve -- maybe Vladimir can take a look?