This is an archive of the discontinued LLVM Phabricator instance.

Add parentheses around arithmetic in operand of '|' in llvm-dwp.cpp.
ClosedPublic

Authored by congliu on Feb 18 2016, 5:10 AM.

Diff Detail

Event Timeline

congliu updated this revision to Diff 48300.Feb 18 2016, 5:10 AM
congliu retitled this revision from to Add parentheses around arithmetic in operand of '|' in llvm-dwp.cpp..
congliu updated this object.
congliu added a reviewer: bkramer.
congliu added a subscriber: cfe-commits.
bkramer edited edge metadata.Feb 18 2016, 5:14 AM

I think this is the wrong solution. Per http://www.dwarfstd.org/ShowIssue.php?issue=140421.1

2.  Calculate a secondary hash H' = (((S >> 32) & MASK(k)) | 1).
[...]
4.  Let H = (H + H') modulo M. Repeat at Step 3.

So the OR has to happen before the ADD.

congliu updated this revision to Diff 48301.Feb 18 2016, 5:20 AM
congliu edited edge metadata.
  • Address review comment.
bkramer accepted this revision.Feb 18 2016, 5:27 AM
bkramer edited edge metadata.

LGTM, will commit it for you.

This revision is now accepted and ready to land.Feb 18 2016, 5:27 AM
This revision was automatically updated to reflect the committed changes.

Thanks all! Which compiler flagged this? Wonder if/why Clang didn't flag it
for me?