aboutsummaryrefslogtreecommitdiff
path: root/libcpp/line-map.c
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2018-08-07 17:10:29 +0100
committerJonathan Wakely <redi@gcc.gnu.org>2018-08-07 17:10:29 +0100
commit1d1b732865a2dd3a97b8a8e605d7c5906ab0df0e (patch)
tree2eca860ce69658e282f224ed7764199fd83d39ba /libcpp/line-map.c
parente81c3c1e9cc642160749ad7a0577e1d18698438e (diff)
downloadgcc-1d1b732865a2dd3a97b8a8e605d7c5906ab0df0e.zip
gcc-1d1b732865a2dd3a97b8a8e605d7c5906ab0df0e.tar.gz
gcc-1d1b732865a2dd3a97b8a8e605d7c5906ab0df0e.tar.bz2
PR libstdc++/86861 Meet precondition for Solaris memalign
Solaris memalign requires alignment to be at least sizeof(int), so increase it as needed. Also move the check for valid alignments from the fallback implementation of aligned_alloc into operator new, as it's required for all of aligned_alloc, memalign, posix_memalign and __aligned_malloc. This adds a branch to check for undefined behaviour which we could just ignore, so the check could just be removed. It should certainly be removed if PR 86878 is implemented to issue a warning about calls with invalid alignments. PR libstdc++/86861 * libsupc++/new_opa.cc [_GLIBCXX_HAVE_MEMALIGN] (aligned_alloc): Replace macro with inline function. [__sun]: Increase alignment to meet memalign precondition. [!HAVE__ALIGNED_MALLOC && !HAVE_POSIX_MEMALIGN && !HAVE_MEMALIGN] (aligned_alloc): Move check for valid alignment to operator new. Remove redundant check for non-zero size, it's enforced by the caller. (operator new): Move check for valid alignment here. Use __builtin_expect on check for zero size. From-SVN: r263360
Diffstat (limited to 'libcpp/line-map.c')
0 files changed, 0 insertions, 0 deletions