From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id B643A3858D35; Mon, 21 Sep 2020 13:29:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B643A3858D35 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1600694947; bh=8LICZeCtZbF40U/5G94Hq8lxSXfpxdSP6heQh07BuTs=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NdWTqdbYXKnT+Fnev8FJohcitg+e8zGVkWrqhyHqNCKDc/eCfrtmZ0akba1JGwmRn hWswKQNmAme8UqFn+37sy1k3HQms5HuTfwfvyQCVQS6Xr5q84v35SUvUn3YI781yMR t2Ur2Uz0Pc7sOr1NCcQw6vHGWd8idCW8FKMGjdUE= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug libstdc++/97132] assume_aligned is not constexpr Date: Mon, 21 Sep 2020 13:29:07 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: libstdc++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: redi at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Sep 2020 13:29:07 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97132 --- Comment #5 from CVS Commits --- The master branch has been updated by Jonathan Wakely : https://gcc.gnu.org/g:f10ed928e2f8ecc2c859abff8f2f9296b11b8d95 commit r11-3324-gf10ed928e2f8ecc2c859abff8f2f9296b11b8d95 Author: Jonathan Wakely Date: Mon Sep 21 14:28:58 2020 +0100 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.=