On Wed, Nov 6, 2013 at 8:26 AM, Martin Jambor <mjam...@suse.cz> wrote: > Hi, > > last Thursday I had to revert a previous version of this patch because > it has caused a lot of trouble on various platforms I did not test it > on. The patch is still very similar to its previous iteration > (http://gcc.gnu.org/ml/gcc-patches/2013-10/msg02183.html) the only > major difference is that I moved more after-the-fact re-analyzing from > find_moveable_pseudos to a point when my transformation also finished. > > The problem with it was that REG_N_REFS of the pseudos introduced by > my code was not set and thus reload ignored and let it slip through > instead of generating spills. This is fixed by moving the > re-computation of regstat_n_sets_and_refs in > regstat_init_n_sets_and_refs to after my transformation. In order to > avoid similar surprises I have moved all other re-computations from > find_moveable_pseudos to the caller in ira, namely: > > fix_reg_equiv_init (); > expand_reg_info (); > regstat_free_n_sets_and_refs (); > regstat_free_ri (); > regstat_init_n_sets_and_refs (); > regstat_compute_ri (); > > I have also bootstrapped and tested the patch not only on x86_64-linux > but also on i686-linux and ppc64-linux (without Ada though). I have > made sure that the reported problem does not occur on cris-elf and > sh-none-elf cross compilers. (I could not reproduce it on arm, and do > not have access to sparc but it was also reported there.) > > Another minor change which I erroneously omitted the last time is that > the testcases are run on x86_64 only because that is the only platform > where I know the transformation currently takes place. The reason why > I did not move them to a target-specific directory is that I believe > the transformation can be beneficial on other platforms as well. For > example, PR 10474 was actually filed against PPC but this patch does > not work there because the initial move of the parameter is done in a > parallel insn: > > (parallel [ > (set (reg:CC 124) > (compare:CC (reg:DI 3 3 [ i ]) > (const_int 0 [0]))) > (set (reg/v/f:DI 123 [ i ]) > (reg:DI 3 3 [ i ])) > ]) > > which fails my single_set test. However, the mechanism can be > extended to handle these situations as well and afterwards we could > run the test also on ppc64. > > So, Vlad, Steven, do you think that this time I have re-computed all > that is necessary? Do you think the patch is OK? > > Thanks a lot and sorry for the breakage, > > Martin > > > 2013-11-04 Martin Jambor <mjam...@suse.cz> > > PR rtl-optimization/10474 > * ira.c (interesting_dest_for_shprep): New function. > (split_live_ranges_for_shrink_wrap): Likewise. > (find_moveable_pseudos): Move calculation of dominance info, > df_analysios and the final anlyses to... > (ira): ...here, call split_live_ranges_for_shrink_wrap. > > testsuite/ > * gcc.dg/pr10474.c: New testcase. > * gcc.dg/ira-shrinkwrap-prep-1.c: Likewise. > * gcc.dg/ira-shrinkwrap-prep-2.c: Likewise. >
This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59099 -- H.J.