Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions libc/src/__support/big_int.h
Original file line number Diff line number Diff line change
Expand Up @@ -790,11 +790,21 @@ struct BigInt {
remainder[pos] = rem;
}

// GCC currently emits a false-positive warning on this for some compilers.
#ifdef __GNUC__
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Waggressive-loop-optimizations"
#endif

// Set the remaining lower bits of the remainder.
for (; pos > 0; --pos) {
remainder[pos - 1] = val[pos - 1];
}

#ifdef __GNUC__
#pragma GCC diagnostic pop
#endif

*this = quotient;
return remainder;
}
Expand Down Expand Up @@ -851,8 +861,8 @@ struct BigInt {
result[i] = lhs[i] OP rhs[i]; \
return result; \
} \
LIBC_INLINE friend constexpr BigInt operator OP##=(BigInt &lhs, \
const BigInt &rhs) { \
LIBC_INLINE friend constexpr BigInt operator OP## = \
(BigInt & lhs, const BigInt &rhs) { \
for (size_t i = 0; i < WORD_COUNT; ++i) \
lhs[i] OP## = rhs[i]; \
return lhs; \
Expand Down
Loading