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]

Re: [patch i386]: PR/38900 ICE for fastcall functions with -O2


2009/7/7 Richard Henderson <rth@redhat.com>:
> On 07/07/2009 05:41 AM, Kai Tietz wrote:
>>
>> So, I tried to solve this by adding to FUNCTION_ARG_REGNO_P an
>> additional function type argument to make better choices about call
>> used registers (which is in fact an issue for df-scan.c and rtlanal.c,
>> but this had no effect on this spilling issue.
>> So for the first, I would like to avoid this ICE and afterward to
>> investigate in more detail why register allocator fails to see that
>> ecx and edx are in use.
>
> FUNCTION_ARG_REGNO_P is irrelevant; it tests only that the register
> might be a function argument register. ?Frankly, I'm not quite sure
> why it's still around -- getting hold of the actual argument registers
> for a given function isn't hard...

Hmm, well to get rid of it would be good. The otherway would be to add
here function type dependent check. Otherwise df-scan and rtlanal
aren't analyzing corret and may some optimizations aren't done.

> The real problem is with register classes. ?The register allocator
> choses the wrong register class (CREG), because there's no register
> class that contains AX+DX+CX. ?Since it later *does* notice that
> CX is in use, and it thinks that only CX is allowed, it aborts.
>
> If we invent such a register class that contains all of the
> registers we could be using for this insn (AX+DX+CX on 32-bit),
> then suddenly the register allocator is quite happy to fill our
> request.
>
> This patch is slightly more complicated than that because I noticed
> that 64-bit code was being more conservative than it needed to be,
> and that there was a bug in sibcalling between MS and SYSV abis.
>
> Please give it a whirl.

I am just on regression tests for this patch. So far I know, that this
patch works for x86 mingw for head and 4.4. The new testcases are
passing and I got no regression.
For x64 version I am still on regression test. Tests for sibcalling
are passing, but I want to wait until the tests for cross-abi checks
passed, too.

Thanks,
Kai


-- 
|  (\_/) This is Bunny. Copy and paste
| (='.'=) Bunny into your signature to help
| (")_(") him gain world domination


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