forked from gcc-mirror/gcc
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid undefined shifts in ceil2 operations
For values where the result cannot be represented the shift width would be equal to the width of the type, which is undefined. Perform two well-defined shifts instead of one possible undefined shift. * include/bits/hashtable_policy.h (__clp2): Fix calculation for LLP64 targets where sizeof(size_t) > sizeof(long). Avoid undefined shifts of the number of bits in the type. * include/std/bit (__ceil2): Avoid undefined shifts. * testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Test values with the most signifiant bit set. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@263986 138bc75d-0d04-0410-961f-82ee72b054a4
- Loading branch information
redi
committed
Aug 30, 2018
1 parent
abf0dec
commit fe92dce
Showing
4 changed files
with
24 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
2018-08-30 Jonathan Wakely <[email protected]> | ||
|
||
* include/bits/hashtable_policy.h (__clp2): Fix calculation for LLP64 | ||
targets where sizeof(size_t) > sizeof(long). Avoid undefined shifts | ||
of the number of bits in the type. | ||
* include/std/bit (__ceil2): Avoid undefined shifts. | ||
* testsuite/26_numerics/bit/bit.pow.two/ceil2.cc: Test values with | ||
the most signifiant bit set. | ||
|
||
* config/abi/pre/gnu.ver: Add missing exports for mingw. | ||
|
||
* include/ext/pointer.h (_Pointer_adapter): Define operators for | ||
|
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
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
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