[Bug ipa/123227] [13/14/15/16 regression] ICF forgets to compare nonnull attribute (and thus member and non-member functions)

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Thu Jan 22 01:31:00 GMT 2026


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |pinskia at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

--- Comment #6 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
There is code which does the comparison but some reason it is not rejecting
this:
```
  /* Checking function attributes.
     This is quadratic in number of attributes  */
  if (comp_type_attributes (TREE_TYPE (decl),
                            TREE_TYPE (item->decl)) != 1)
    return return_false_with_msg ("different type attributes");
  if (!attribute_list_equal (DECL_ATTRIBUTES (decl),
                             DECL_ATTRIBUTES (item->decl)))
    return return_false_with_msg ("different decl attributes");
```


More information about the Gcc-bugs mailing list