-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
or32: Fix overflow detection on -O2 compilation
The check for overflow assumes that the compiler will allow us to detect when a value overflows to a negative number. When running GCC with -O2 and above this overflow cannot be detected. The C standard explains that overflow behavior is undefined meaning this expected overflow causing a negative number cannot be guaranteed and it is not. Multiple overflow flag tests were failing. Fix the detection buy just using the compiler builtins for detecting overflow conditions.
- Loading branch information
1 parent
b735ef8
commit 0386f2b
Showing
1 changed file
with
7 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters