From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 030B03858002; Wed, 31 Jan 2024 14:50:58 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 030B03858002 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1706712659; bh=LZLXwb5M67/OIG6kDjUN/7CSK2meNt7KEW6GT7DEKo8=; h=From:To:Subject:Date:In-Reply-To:References:From; b=ZBCnAjOvHRZNiZyWwRqpXqJZq0TcQIq6MU5hdWFsRXIirsy42OIAdA54lWEXANvLa 32I7Ogio3DhMNogKmDXhxjOqMu3cALLMxT6okwQ+ZyNkVN217V2Z6HkVNhN9UBUQYC +7UZbSLtb7x3EVD98Omwfz7lVmGAmfBw81B5j0ig= From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug sanitizer/112644] [14 Regression] Some of the hwasan testcase fail after the recent merge Date: Wed, 31 Jan 2024 14:50:58 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: sanitizer X-Bugzilla-Version: 14.0 X-Bugzilla-Keywords: missed-optimization, testsuite-fail 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: tnfchris at gcc dot gnu.org X-Bugzilla-Target-Milestone: 14.0 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 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D112644 --- Comment #10 from GCC Commits --- The master branch has been updated by Tamar Christina : https://gcc.gnu.org/g:0debaceb11dee9781f9a8b320cb5893836324878 commit r14-8660-g0debaceb11dee9781f9a8b320cb5893836324878 Author: Tamar Christina Date: Wed Jan 31 14:50:33 2024 +0000 hwasan: instrument new memory and string functions [PR112644] Recent libhwasan updates[1] intercept various string and memory functio= ns. These functions have checking in them, which means there's no need to inline the checking. This patch marks said functions as intercepted, and adjusts a testcase to handle the difference. It also looks for HWASAN in a check in expand_builtin. This check originally is there to avoid using expand to inline the behaviour of builtins like memset which are intercepted by ASAN and hence which we rely on the function call staying as a function call. With the new reliance on function calls in HWASAN we need to do the same thing for HWASAN too. HWASAN and ASAN don't seem to however instrument the same functions. Looking into libsanitizer/sanitizer_common/sanitizer_common_interceptors_memintrinsics.i= nc it looks like the common ones are memset, memmove and memcpy. The rest of the routines for asan seem to be defined in compiler-rt/lib/asan/asan_interceptors.h however compiler-rt/lib/hwasan/ does not have such a file but it does have compiler-rt/lib/hwasan/hwasan_platform_interceptors.h which it looks li= ke is forcing off everything but memset, memmove, memcpy, memcmp and bcmp. As such I've taken those as the final list that hwasan currently suppor= ts. This also means that on future updates this list should be cross checke= d. [1] https://discourse.llvm.org/t/hwasan-question-about-the-recent-interceptors-= being-added/75351 gcc/ChangeLog: PR sanitizer/112644 * asan.h (asan_intercepted_p): Incercept memset, memmove, memcpy and memcmp. * builtins.cc (expand_builtin): Include HWASAN when checking for builtin inlining. gcc/testsuite/ChangeLog: PR sanitizer/112644 * c-c++-common/hwasan/builtin-special-handling.c: Update testca= se. Co-Authored-By: Matthew Malcomson =