Commit c0ed9d16 authored by Jiayao Lin's avatar Jiayao Lin Committed by Commit Bot

Fix unused-but-set-variable building with GCC

When building with GCC8.1, has error: variable ‘kUpperBoundIsMax’,
‘kLowerBoundIsMin’ set but not used [-Werror=unused-but-set-variable]
so, using USE(var) to fix this error

Change-Id: I05133d3cb5843f4c0a4a59591470b0fcaa21f16f
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1848852
Commit-Queue: Clemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarClemens Backes <clemensb@chromium.org>
Reviewed-by: 's avatarMichael Starzinger <mstarzinger@chromium.org>
Cr-Commit-Position: refs/heads/master@{#64245}
parent d509ed53
...@@ -388,6 +388,9 @@ bool is_inbounds(float_t v) { ...@@ -388,6 +388,9 @@ bool is_inbounds(float_t v) {
constexpr bool kUpperBoundIsMax = constexpr bool kUpperBoundIsMax =
static_cast<biggest_int_t>(kUpperBound) == static_cast<biggest_int_t>(kUpperBound) ==
static_cast<biggest_int_t>(std::numeric_limits<int_t>::max()); static_cast<biggest_int_t>(std::numeric_limits<int_t>::max());
// Using USE(var) is only a workaround for a GCC 8.1 bug.
USE(kLowerBoundIsMin);
USE(kUpperBoundIsMax);
return (kLowerBoundIsMin ? (kLowerBound <= v) : (kLowerBound < v)) && return (kLowerBoundIsMin ? (kLowerBound <= v) : (kLowerBound < v)) &&
(kUpperBoundIsMax ? (v <= kUpperBound) : (v < kUpperBound)); (kUpperBoundIsMax ? (v <= kUpperBound) : (v < kUpperBound));
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment