On 09/12/16 16:02, Ramana Radhakrishnan wrote: > On Fri, Dec 9, 2016 at 3:58 PM, Bernd Schmidt <bschm...@redhat.com> wrote: >> On 12/09/2016 04:34 PM, Andre Vieira (lists) wrote: >> >>> Regardless, the other testcases I add in this patch show a sub-optimal >>> transformation done by postreload, turning direct calls into indirect >>> calls, for targets which have specifically pointed out that no CSE >>> should be done on functions through 'NO_FUNCTION_CSE'. >> >> >> What I'm wondering about is whether the patch wouldn't also prevent the >> opposite transformation. Is there a reason not to do that one? Can the >> problem be modeled by tweaking costs? > > I really don't think we should have a solution that relies on costs > for correctness . > > regards > Ramana >
Regardless, 'reload_cse_simplify' would never perform the opposite transformation. It checks whether it can replace anything within the first argument INSN, with the second argument TESTREG. As the name implies this will always be a register. I double checked, the function is only called in 'reload_cse_regs' and 'testreg' is created using 'gen_rtx_REG'. Cheers, Andre