r263986 - in /trunk/libstdc++-v3: ChangeLog inc...

redi@gcc.gnu.org redi@gcc.gnu.org
Thu Aug 30 15:07:00 GMT 2018


Author: redi
Date: Thu Aug 30 15:07:35 2018
New Revision: 263986

URL: https://gcc.gnu.org/viewcvs?rev=263986&root=gcc&view=rev
Log:
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.

Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/bits/hashtable_policy.h
    trunk/libstdc++-v3/include/std/bit
    trunk/libstdc++-v3/testsuite/26_numerics/bit/bit.pow.two/ceil2.cc



More information about the Libstdc++-cvs mailing list