This is the mail archive of the 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]

Re: [PATCH][M68K] Fix reload failure on cmpdi instruction

Jeff Law wrote:
Maxim Kuvyrkov wrote:


I speculate that the fact that the additional operand is not trivially dead puts additional pressure on reload, which, combined with restrictions of m68k being cc0 target (reload can't use output_reloads for this pattern as it sets cc0) makes reload to fail.

The fix I come up with is to rewrite the expander and the pattern to use (match_scratch) instead. It seems easier for reload to replace (scratch) than to replace a pseudo with a hard register. And, in the context of cmpdi instruction, pseudo and scratch are equivalent.

Tested on ColdFire bare-metal with no regression (gcc, g++ and libstdc++ testsuites). Ok for trunk?
ISTM that we might be papering over a register allocation/reloading problem. This is an area that has been particularly problematical for IRA. So while I'm absolutely in favor of using the match_scratch approach, I'd like to first verify that we're doing the right thing in IRA.

Can you pass along the debugging dumps and a reference to the test which is failing?

It appears that the test does not fail on trunk; I originally investigated this bug against GCC 4.3, but IRA seems to handle the case properly. Anyway, this is still a good clean up, right?

Just in case you are interested in 4.3 dumps, they are attached; see directory 'bad', directory 'good' contains dumps from current trunk. The compile line is m68k-elf-gcc -O0 -S ./gcc-4.3/gcc/testsuite/gcc.c-torture/compile/20050303-1.c

-- MaximK

Attachment: cmpdi.tar.bz2
Description: Binary data

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