Jonathan Wakely f10ed928e2 libstdc++: Make std::assume_aligned a constexpr function [PR 97132]
The cast from void* to T* in std::assume_aligned is not valid in a
constexpr function. The optimization hint is redundant during constant
evaluation anyway (the compiler can see the object and knows its
alignment). Simply return the original pointer without applying the
__builtin_assume_aligned hint to it when doing constant evaluation.

This change also removes the preprocessor branch that works around
uintptr_t not being available. We already assume that type is present
elsewhere in the library.

libstdc++-v3/ChangeLog:

	PR libstdc++/97132
	* include/bits/align.h (align) [!_GLIBCXX_USE_C99_STDINT_TR1]:
	Remove unused code.
	(assume_aligned): Do not use __builtin_assume_aligned during
	constant evaluation.
	* testsuite/20_util/assume_aligned/1.cc: Improve test.
	* testsuite/20_util/assume_aligned/97132.cc: New test.
2020-09-21 14:28:58 +01:00
2020-09-10 10:17:51 +02:00
2020-09-18 00:16:24 +00:00
2020-01-21 23:53:22 -08:00
2020-09-16 00:16:37 +00:00
2020-09-12 00:16:30 +00:00
2020-09-17 00:16:31 +00:00
2020-09-11 00:16:28 +00:00
2020-09-18 00:16:24 +00:00
2020-07-31 00:16:26 +00:00
2020-09-18 00:16:24 +00:00
2020-09-04 00:16:32 +00:00
2020-09-17 00:16:31 +00:00
2020-09-09 00:16:29 +00:00
2020-07-25 00:16:22 +00:00
2020-05-30 00:16:27 +00:00
2020-09-11 00:16:28 +00:00
2020-05-30 00:16:27 +00:00
2020-07-17 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-09-11 00:16:28 +00:00
2020-05-30 00:16:27 +00:00
2020-05-30 00:16:27 +00:00
2020-01-15 14:29:53 +01:00
2020-06-12 16:03:02 +02:00
2020-09-19 00:16:29 +00:00

This directory contains the GNU Compiler Collection (GCC).

The GNU Compiler Collection is free software.  See the files whose
names start with COPYING for copying permission.  The manuals, and
some of the runtime libraries, are under different terms; see the
individual source files for details.

The directory INSTALL contains copies of the installation information
as HTML and plain text.  The source of this information is
gcc/doc/install.texi.  The installation information includes details
of what is included in the GCC sources and what files GCC installs.

See the file gcc/doc/gcc.texi (together with other files that it
includes) for usage and porting information.  An online readable
version of the manual is in the files gcc/doc/gcc.info*.

See http://gcc.gnu.org/bugs/ for how to report bugs usefully.

Copyright years on GCC source files may be listed using range
notation, e.g., 1987-2012, indicating that every year in the range,
inclusive, is a copyrightable year that could otherwise be listed
individually.
Description
No description provided
Readme 3.1 GiB
Languages
C 48%
Ada 18.3%
C++ 14.1%
Go 7%
GCC Machine Description 4.6%
Other 7.7%