From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 0A41B3857015; Mon, 5 Oct 2020 08:24:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0A41B3857015 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97145] Sanitizer pointer-subtract breaks constexpr functions subtracting pointers Date: Mon, 05 Oct 2020 08:24:44 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 10.2.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: jakub 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, 05 Oct 2020 08:24:45 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97145 --- Comment #5 from CVS Commits --- The releases/gcc-10 branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:3f56563cf84f97ef271ef0f949a571c13cdd06e2 commit r10-8850-g3f56563cf84f97ef271ef0f949a571c13cdd06e2 Author: Jakub Jelinek Date: Tue Sep 22 21:06:32 2020 +0200 c++: Ignore __sanitizer_ptr_{sub,cmp} builtin calls during constant expression evaluation [PR97145] These two builtin calls are added already during parsing before pointer subtractions or comparisons, normally they perform runtime verification of whether the pointers point to the same object or different objects, but during constant expressione valuation we don't really need those builtins for anything. 2020-09-22 Jakub Jelinek PR c++/97145 * constexpr.c (cxx_eval_builtin_function_call): Return void_node for calls to __sanitize_ptr_{sub,cmp} builtins. * g++.dg/asan/pr97145.C: New test. (cherry picked from commit bc13106e0414b86af8f6878e7681e6a959921b9e)=