[llvm] 15f2d4f - [AIX] Fixed "comparison of unsigned expression >= 0 is always true" gcc warnings.

Hubert Tong via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 15 09:23:56 PST 2020


On Mon, Dec 14, 2020 at 8:36 PM David Blaikie via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Any idea if this is the most suitable fix? Is "Bits" representing negative
> values? If not, perhaps it'd be more appropriate to remove the >= 0
> comparison, rather than to change the type?
>
For context, this aspect of the implementation will likely be replaced as
further functionality (to implement the encoding form when vector
parameters are present) is implemented. In terms of NFC evolution of this
code, the reparsing loop is not ideal. If the code was not being changed
anyway, it would make sense to store the "next position" alongside the
encoded bitstring.

As for the signedness of the type: I believe changing the type is
appropriate in this case even if the comparison is modified to avoid the
subtraction. I do agree that changing the comparison should also be done;
however, the change to the type was the easiest change to eyeball in the
context of responding to the breakage.


>
> On Mon, Dec 14, 2020 at 8:09 AM via llvm-commits <
> llvm-commits at lists.llvm.org> wrote:
>
>>
>> Author: diggerlin
>> Date: 2020-12-14T11:08:40-05:00
>> New Revision: 15f2d4f198380762e9fcf6b456d405078b87ae7a
>>
>> URL:
>> https://github.com/llvm/llvm-project/commit/15f2d4f198380762e9fcf6b456d405078b87ae7a
>> DIFF:
>> https://github.com/llvm/llvm-project/commit/15f2d4f198380762e9fcf6b456d405078b87ae7a.diff
>>
>> LOG: [AIX] Fixed "comparison of unsigned expression >= 0 is always true"
>> gcc warnings.
>>
>> Summary:
>>
>> fixed a  Fixed "comparison of unsigned expression >= 0 is always true"
>> gcc warnings.
>> http://lab.llvm.org:8011/#/builders/5/builds/2407/steps/2/logs/stdio
>>
>> the error caused by patch https://reviews.llvm.org/D92398
>>
>> Added:
>>
>>
>> Modified:
>>     llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
>>
>> Removed:
>>
>>
>>
>>
>> ################################################################################
>> diff  --git a/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
>> b/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
>> index 02a425044c75..d364eb9d3996 100644
>> --- a/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
>> +++ b/llvm/lib/Target/PowerPC/PPCMachineFunctionInfo.cpp
>> @@ -67,7 +67,7 @@ bool PPCFunctionInfo::isLiveInZExt(Register VReg) const
>> {
>>
>>  void PPCFunctionInfo::appendParameterType(ParamType Type) {
>>    uint32_t CopyParamType = ParameterType;
>> -  unsigned Bits = 0;
>> +  int Bits = 0;
>>
>>    // If it is fixed type, we only need to increase the FixedParamNum, for
>>    // the bit encode of fixed type is bit of zero, we do not need to
>> change the
>>
>>
>>
>> _______________________________________________
>> llvm-commits mailing list
>> llvm-commits at lists.llvm.org
>> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201215/3606fe99/attachment.html>


More information about the llvm-commits mailing list