dspr2-MULT.c and dspr2-MULTU.c are supposed to test that we use the DSP accumulator registers to parallelise multiplications. They don't work in 4.7, and I'm about to XFAIL them. There seem to be two main problems: * The cost of moving between DSP accumulators is greater than the cost of moving a DSP register to or from memory. When I last looked, this was enough to make the register allocator consider memory to be cheaper. This isn't a problem without -mdsp because there is then only one accumulator register, LO+HI. (Note that we no longer allow HI and LO to store independent values.) The cost of moving between accumulators is therefore ignored. On some (many?) targets, moving something out of an accumulator and back again _is_ more expensive than storing an accumulator to memory, so this isn't necessarily a bug in the backend. * Even if we massage the costs to avoid that problem, each of the pseudos that we'd like to use accumulators has one "=ka" constraint and one "d" constraint. At one point this meant that DSP_REGS and GENERAL_REGS had the same cost, and reg_alloc_order could be used to prefer accumulators: http://gcc.gnu.org/ml/gcc/2010-12/msg00471.html http://gcc.gnu.org/ml/gcc/2011-01/msg00093.html But GENERAL_REGS now seems to have a lower cost, and since GENERAL_REGS are much easier to spill than DSP_REGS, it's hard to argue with that.
Author: rsandifo Date: Mon Jan 2 11:33:35 2012 New Revision: 182793 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182793 Log: gcc/testsuite/ PR target/51729 * gcc.target/mips/dspr2-MULT.c: Remove -ffixed-hi -ffixed-lo. XFAIL. * gcc.target/mips/dspr2-MULTU.c: Likewise. Modified: trunk/gcc/testsuite/ChangeLog trunk/gcc/testsuite/gcc.target/mips/dspr2-MULT.c trunk/gcc/testsuite/gcc.target/mips/dspr2-MULTU.c
Confirmed.
The affected tests appear to have started passing again since this commit: svn: r211959 2014-06-24 Catherine Moore <clm@codesourcery.com> Sandra Loosemore <sandra@codesourcery.com> gcc/ * config/mips/mips.c (mips_order_regs_for_local_alloc): Delete. * config/mips/mips.h (ADJUST_REG_ALLOC_ORDER): Delete. * config/mips/mips-protos.h (mips_order_regs_for_local_alloc): Delete. Irritatingly they now pass for -O2 and -O3 but still fail for -O1 and -Os. I was half tempted to submit a patch to just be content that we get multiple accumulators now used at -O2 and -O3 and leave it at that but I think that is probably the wrong attitude. Has anyone else noticed the change in state for these tests and looked into it, planning to look into it or have any thoughts? I'll take a look when I get chance.
Seems unlikely that this will ever be fixed. The main point of the PR was to act as a reference point for the XFAIL, and closing the PR wouldn't affect that.