[PATCH 0/9] RFC: selftests based on RTL dumps
Bernd Schmidt
bschmidt@redhat.com
Tue Sep 13 11:35:00 GMT 2016
On 09/12/2016 08:57 PM, David Malcolm wrote:
> I'm not sure I follow - this sounds like a dedicated target for
> selftesting.
>
> Would it be a separate configuration i.e. something like:
> ../src/configure --target=rtl-selftest
> or somesuch?
The way I imagine it working, the top-level Makefile would create a
selftest-gcc/ subdirectory, and run a configure line much like the above
inside it. It would live independently of the real compiler we're
building in gcc/.
That's not something I'm deciding, it needs a broader consensus. But I
feel pretty strongly that this is how things should be organized.
>>> + const char *input_dump
>>> + = ("(insn 8 0 9 2 (set (reg:DI 78)\n"
>>> + " (lshiftrt:DI (reg:DI 76)\n"
>>> + " (const_int 32 [0x20])))\n"
>>> + " ../../src/gcc/testsuite/gcc.dg/asr_div1.c:14\n"
>>> + " 641 {*aarch64_lshr_sisd_or_int_di3}\n"
>>> + " (expr_list:REG_DEAD (reg:DI 76)\n"
>>> + " (nil)))\n"
>>> + "(insn 9 8 0 2 (set (reg:SI 79)\n"
>>> + " (ashiftrt:SI (subreg:SI (reg:DI 78) 0)\n"
>>> + " (const_int 3 [0x3])))\n"
>>> + " ../../src/gcc/testsuite/gcc.dg/asr_div1.c:14\n"
>>> + " 642 {*aarch64_ashr_sisd_or_int_si3}\n"
>>> + " (expr_list:REG_DEAD (reg:DI 78)\n"
>>> + " (nil)))\n");
>>
>> I can sort of see the desire to just copy&paste dumps into this, but
>> this strikes me as really ugly. Especially if we end up using real
>> targets this hard-codes not just pattern structure but also pattern
>> names, which I think is too great a burden on target maintainers.
>
> Note that the loader now resets INSN_CODE to -1, regardless of the
> actual code passed in, to force re-recognition, and to isolate the
> dumps somewhat from changes to the .md files. So although the above
> says insn 641 and 642 (for some snapshot of the aarch64 md file), it
> gets reset to -1.
Best to find out a way to avoid including it in the strings then, to
avoid confusion.
Bernd
More information about the Gcc-patches
mailing list