Impala Public Jenkins has submitted this change and it was merged. ( 
http://gerrit.cloudera.org:8080/15962 )

Change subject: IMPALA-9762: Fix GCC7 shift-count-overflow in 
tuple-row-compare.cc
......................................................................

IMPALA-9762: Fix GCC7 shift-count-overflow in tuple-row-compare.cc

This fixes a GCC 7 compilation error for this code in
TupleRowZOrderComparator's GetSharedIntRepresentation() and
GetSharedFloatRepresentation():

  return (static_cast<U>(val) <<
      std::max((sizeof(U) - sizeof(T)) * 8, (uint64_t)0)) ^ mask;

In this case, the std::max is running with uint64_t arguments. For
template instatiations with sizeof(T) > sizeof(U), this results
in integer overflow and a very large positive integer causing
the shift-count-overflow. These instantiations are not used by
Impala, but the compiler still needs to generate them.

This changes the logic to use signed integers for the std::max,
avoiding the shift-count-overflow.

Testing:
 - Build on GCC 4.9.2 and GCC 7
 - Core tests

Change-Id: I518e8bed1bb8d49d9cb76a33b07b665e15dfef87
Reviewed-on: http://gerrit.cloudera.org:8080/15962
Reviewed-by: Impala Public Jenkins <[email protected]>
Tested-by: Impala Public Jenkins <[email protected]>
---
M be/src/util/tuple-row-compare.cc
1 file changed, 7 insertions(+), 5 deletions(-)

Approvals:
  Impala Public Jenkins: Looks good to me, approved; Verified

--
To view, visit http://gerrit.cloudera.org:8080/15962
To unsubscribe, visit http://gerrit.cloudera.org:8080/settings

Gerrit-Project: Impala-ASF
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I518e8bed1bb8d49d9cb76a33b07b665e15dfef87
Gerrit-Change-Number: 15962
Gerrit-PatchSet: 4
Gerrit-Owner: Joe McDonnell <[email protected]>
Gerrit-Reviewer: Impala Public Jenkins <[email protected]>
Gerrit-Reviewer: Norbert Luksa <[email protected]>
Gerrit-Reviewer: Zoltan Borok-Nagy <[email protected]>

Reply via email to