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

Drea Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2026-10-24
     Ever confirmed|0                           |1
           Keywords|                            |ice-on-valid-code

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---

              if (expr && DECL_P (expr))
                found_match = DECL_PURE_P (expr);


That DECL_P check there should really be TREE_CODE (expr) == FUNCTION_DECL. 
Since DECL_PURE_P is only for function decls:

/* Nonzero in a FUNCTION_DECL means this function should be treated
   as "pure" function (like const function, but may read global memory).
   Note that being pure or const for a function is orthogonal to being
   nothrow, i.e. it is valid to have DECL_PURE_P set and TREE_NOTHROW
   cleared.  */
#define DECL_PURE_P(NODE) (FUNCTION_DECL_CHECK (NODE)->function_decl.pure_flag)

Reply via email to