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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
--- gcc/analyzer/sm-malloc.cc.jj        2021-07-29 13:24:42.664013344 +0200
+++ gcc/analyzer/sm-malloc.cc   2021-08-02 17:42:17.312821855 +0200
@@ -1543,7 +1543,7 @@ known_allocator_p (const_tree fndecl, co

   /* ... or it is a builtin allocator that allocates objects freed with
      __builtin_free.  */
-  if (fndecl_built_in_p (fndecl))
+  if (fndecl_built_in_p (fndecl, BUILT_IN_NORMAL))
     switch (DECL_FUNCTION_CODE (fndecl))
       {
       case BUILT_IN_MALLOC:
fixes this.
As for testcase, one can use any backend builtin, e.g.
/* { dg-do compile } */
/* { dg-options "-fanalyzer" } */

void
foo ()
{
  __builtin_ia32_pause ();
}

reproduces it on x86 too.

Reply via email to