This is an archive of the discontinued LLVM Phabricator instance.

Update code to silent some ARM/ARM64 specific compiler warnings
AbandonedPublic

Authored by omjavaid on Dec 8 2015, 3:20 PM.

Details

Reviewers
tberghammer
Summary

Following changes remove conditions where an unsigned integer is being tested to be greater or equal to zero.

These conditions will always remain true and will result in compiler warning though most compilers will optimize this out.

Diff Detail

Event Timeline

omjavaid updated this revision to Diff 42239.Dec 8 2015, 3:20 PM
omjavaid retitled this revision from to Update code to silent some ARM/ARM64 specific compiler warnings.
omjavaid updated this object.
omjavaid added a reviewer: tberghammer.
omjavaid added a subscriber: lldb-commits.
tberghammer requested changes to this revision.Dec 9 2015, 2:48 AM
tberghammer edited edge metadata.

We discussed the same change recently (D13866) and the general opinion was that the original code have the right semantics and we don't want to change it just to silence some warnings.

If you want to get rid of these warnings then I would suggest to do it with adding a cast before the comparison (I haven't tested it):

if ((int)reg_num >= x0 && (int)reg_num <= pc) // We are casting to int to silence a gcc warning
This revision now requires changes to proceed.Dec 9 2015, 2:48 AM
omjavaid abandoned this revision.Dec 14 2015, 1:58 AM

Let the warnings stay for now.