This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: gcc-4.5/4.4: Bug in .subreg1 pass?
- From: Denis Chertykov <chertykov at gmail dot com>
- To: Georg-Johann Lay <avr at gjlay dot de>
- Cc: Eric Botcazou <ebotcazou at adacore dot com>, gcc at gcc dot gnu dot org, Jeff Law <law at redhat dot com>, Paul Koning <paul_koning at dell dot com>, Michael Matz <matz at suse dot de>
- Date: Tue, 1 Mar 2011 18:52:00 +0300
- Subject: Re: gcc-4.5/4.4: Bug in .subreg1 pass?
- References: <4D66659D.4060300@gjlay.de> <2D5ECE31-6687-4D16-B615-DE9EEB9CE587@dell.com> <4D6807A6.8060605@gjlay.de> <201102252244.34339.ebotcazou@adacore.com> <4D682739.4070409@gjlay.de> <AANLkTimrijP4Bu=V2_nyo_PZGiw8_Tgog_PActL4gQcO@mail.gmail.com> <4D68F9D4.6090508@gjlay.de> <4D69356C.1030307@gjlay.de> <AANLkTikyy8kVd-rwBAb4kVJzGseMQcny3SfybQB6ZTfn@mail.gmail.com> <4D6BFBF4.4010707@gjlay.de>
2011/2/28 Georg-Johann Lay <avr@gjlay.de>:
> Denis Chertykov schrieb:
>>
>> 2011/2/26 Georg-Johann Lay <avr@gjlay.de>:
>>
>>> Ok, this is the patch I meant:
>>>
>>> http://gcc.gnu.org/viewcvs?view=revision&revision=86842
>>>
>>> it allows just Pmode in r29:r28 because of some spill failures in PR15417
>>> and PR12017.
>>
>> It was a stupid workaround.
>> I think that the problem exists anyway because it's not a port problem.
>>
>> Denis.
>
> PR41894 is yet another variation of the problem.
>
> Removong the restricting code like so
>
> int
> avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
> {
> Â/* Disallow QImode in stack pointer regs. Â*/
> Âif ((regno == REG_SP || regno == (REG_SP + 1)) && mode == QImode)
> Â Âreturn 0;
>
> - Â/* The only thing that can go into registers r28:r29 is a Pmode. Â*/
> - Âif (regno == REG_Y && mode == Pmode)
> - Â Âreturn 1;
> -
> - Â/* Otherwise disallow all regno/mode combinations that span r28:r29.
> - Â*/
> - Âif (regno <= (REG_Y + 1) && (regno + GET_MODE_SIZE (mode)) >= (REG_Y +
> 1))
> - Â Âreturn 0;
> -
> Âif (mode == QImode)
> Â Âreturn 1;
>
> Â/* Modes larger than QImode occupy consecutive registers. Â*/
> Âif (regno + GET_MODE_SIZE (mode) > FIRST_PSEUDO_REGISTER)
> Â Âreturn 0;
>
> Â/* All modes larger than QImode should start in an even register. Â*/
> Âreturn !(regno & 1);
> }
>
> leads to correct code.
>
> But I don't understand enough of reload/inerts of fp elimination to estimate
> all undesired side effects.
>
> Maybe someone with more insight in reload can comment on this issue?
As I remeber, this is not a port bug. It was a reload bug.
According to documentation avr_hard_regno_mode_ok must be:
int
avr_hard_regno_mode_ok (int regno, enum machine_mode mode)
{
/* All modes larger than QImode should start in an even register. */
return !(regno & 1);
}
Denis.