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: RFA: Fix crx --enable-werror-always build


On 11/19/2010 11:21 AM, Joern Rennecke wrote:
> Quoting Richard Henderson <rth@redhat.com>:
> 
>> On 11/12/2010 08:22 AM, Joern Rennecke wrote:
>>> +  gcc_assert (REGNO (reg) != CC_REGNUM);
>>
>> This is the only change I'm unsure about.  I wonder if instead
>> the previous IF was supposed to check REG instead of ADDR_REG.
> 
> That seems unlikely, because then the
> 
>            && GET_MODE_SIZE (GET_MODE (SUBREG_REG (addr_reg)))
>            <= UNITS_PER_WORD))
> 
> check would be redundant.

True. 

Comparing this to the i386 legitimate address predicate I see

      if ((strict && ! REG_OK_FOR_BASE_STRICT_P (reg))
          || (! strict && ! REG_OK_FOR_BASE_NONSTRICT_P (reg)))
        /* Base is not valid.  */
        return false;

In the crx case, the un-wrapping of the subreg isn't saved back
into the crx_address structure, and so the subreg will make it to 

      if (address.base && !REGNO_OK_FOR_BASE_P (REGNO (address.base)))

which ought to ICE due to REGNO applied to SUBREG.  Which probably
will never happen, since this only happens for strict, and I expect
that subregs of hard regs are resolved by now.

That said, a more correct patch seems like it would be like this:


r~

Attachment: z
Description: Text document


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