https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104103

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |12.0
           Assignee|unassigned at gcc dot gnu.org      |jakub at gcc dot gnu.org
          Component|testsuite                   |middle-end
     Ever confirmed|0                           |1
                 CC|                            |jakub at gcc dot gnu.org
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2022-01-18

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
I've just debugged this, the following patch fixes that.
.ASAN_MARK, while it takes address of variables, often after they go out of
scope, doesn't access those variables in any way, it poisons or unpoisons the
corresponding shadow memory.

--- gcc/gimple-ssa-warn-access.cc.jj    2022-01-16 20:55:46.783932110 +0100
+++ gcc/gimple-ssa-warn-access.cc       2022-01-18 20:56:13.697780325 +0100
@@ -4232,6 +4232,11 @@ pass_waccess::check_call (gcall *stmt)
   if (gimple_call_builtin_p (stmt, BUILT_IN_NORMAL))
     check_builtin (stmt);

+  /* .ASAN_MARK doesn't access any vars, only modifies shadow memory.  */
+  if (gimple_call_internal_p (stmt)
+      && gimple_call_internal_fn (stmt) == IFN_ASAN_MARK)
+    return;
+
   if (!m_early_checks_p)
     if (tree callee = gimple_call_fndecl (stmt))
       {

Reply via email to