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] Prevent noisey warnings on arm-elf


Brian Sidebotham wrote:
> Andrew Pinski wrote:
> 
>>> -  HOST_WIDE_INT elem = ffs (operands[2]) - 1;
>>> +  HOST_WIDE_INT elem = ffs ((int) operands[2]) - 1;
>>
>> I think this should be:
>> HOST_WIDE_INT elem = ffs (INTVAL (operands[2])) - 1;
> 
> Hi Andrew,
> 
> I have changed this as requested, though I can't find the definition of
> INTVAL, or what difference there is from a plain (int) cast. Attached is
> an updated patch, regression tested, with no new regressions on
> arm-none-elf.

The revised form is correct.  The original code looks like it's just
buggy; the elements of operands[] are not integers but RTX nodes.
INTVAL is the way you get the "int" value of an RTX for a "CONST_INT";
see gcc/rtl.h.

Julian, would you please review and check in Brian's patch, unless you
disagree?

Thanks,

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713


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