This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH, ARM, iWMMXT] Check IWMMXT_GR_REGS in the SECONDARY_RELOAD MACRO


Hi,

  For this simple case, compiled with option -march=iwmmxt -O,
#define N 64
signed int b[N];
signed long long j[N], d[N];
void foo (void)
{
  int i;
  for (i = 0; i < N; i++)
    j[i] = d[i] << b[i];
}
An internal compiler error occurs,
error: insn does not satisfy its constraints:
(insn 112 74 75 3 (set (reg:SI 96 wcgr0)
        (mem/c:SI (plus:SI (reg:SI 3 r3 [orig:174 ivtmp.19 ] [174])
                (reg/f:SI 0 r0 [183])) [0 MEM[symbol: b, index: ivtmp.19_14, offset: 0B]+0 S4 A32])) {*iwmmxt_movsi_insn}
     (nil))

The load address of wmmx wcgr register cannot accept the register offset mode and the reload pass fails to fix it, so that such error happens.
This issue could be solved by adding check code for IWMMXT_GR_REGS class in the SECONDARY_RELOAD MACRO if TARGET_IWMMXT. Current code only check the IWMMXT_REGS group.
Patch attached with a new test.
Pass full dejagnu test. No regression.

Is this fix proper?
OK for trunk?

ChangeLog
gcc/
2013-05-24  Xinyu Qi  <xyqi@marvell.com>

	* config/arm/arm.h (SECONDARY_OUTPUT_RELOAD_CLASS): Check IWMMXT_GR_REGS.
	(SECONDARY_INPUT_RELOAD_CLASS): Likewise.

testsuite/
2013-05-24  Xinyu Qi  <xyqi@marvell.com>

	* gcc.target/arm/mmx-3.c: New test.

Attachment: gr_secondary_reload.diff
Description: gr_secondary_reload.diff


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]