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: [wide-int] Make integer_onep return false for signed 1-bit bitfields


On Wed, Nov 6, 2013 at 11:31 PM, Richard Sandiford
<rdsandiford@googlemail.com> wrote:
> Ping.

Ok.

Thanks,
Richard.

> Richard Sandiford <rdsandiford@googlemail.com> writes:
>> As discussed on gcc@, integer_onep is supposed to return false for
>> a nonzero 1-bit value if the type is signed.
>>
>> Tested on x86_64-linux-gnu and powerpc64-linux-gnu.  OK to install?
>>
>> Thanks,
>> Richard
>>
>>
>> Index: gcc/tree.c
>> ===================================================================
>> --- gcc/tree.c        2013-10-29 19:19:27.623468618 +0000
>> +++ gcc/tree.c        2013-11-02 17:25:06.499657501 +0000
>> @@ -2092,7 +2092,7 @@ integer_onep (const_tree expr)
>>    switch (TREE_CODE (expr))
>>      {
>>      case INTEGER_CST:
>> -      return wi::eq_p (expr, 1);
>> +      return wi::eq_p (wi::to_widest (expr), 1);
>>      case COMPLEX_CST:
>>        return (integer_onep (TREE_REALPART (expr))
>>             && integer_zerop (TREE_IMAGPART (expr)));


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