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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Warning when function       |Warning when function
                   |marked                      |marked
                   |__attribute__((externally_v |__attribute__((externally_v
                   |isible)) uses               |isible)) uses
                   |__attribute__((assume(state |__attribute__((assume(state
                   |ment)))                     |ment))) or openmp
   Last reconfirmed|                            |2026-08-24
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
           Keywords|                            |openmp

--- Comment #1 from Drea Pinski <pinskia at gcc dot gnu.org> ---
Also happens with openmp:

__attribute__((externally_visible)) void f (int *p)
{
  #pragma omp parallel
    while(true)
      ;
}

Confirmed.

But they look like 2 different code that is causing the issue.



create_assumption_fn does this:
  tree attributes = DECL_ATTRIBUTES (current_function_decl);
  if (lookup_attribute ("noipa", attributes) == NULL)
    {
      attributes = tree_cons (get_identifier ("noipa"), NULL, attributes);
      if (lookup_attribute ("noinline", attributes) == NULL)
        attributes = tree_cons (get_identifier ("noinline"), NULL, attributes);
      if (lookup_attribute ("noclone", attributes) == NULL)
        attributes = tree_cons (get_identifier ("noclone"), NULL, attributes);
      if (lookup_attribute ("no_icf", attributes) == NULL)
        attributes = tree_cons (get_identifier ("no_icf"), NULL, attributes);
    }
  DECL_ATTRIBUTES (decl) = attributes;


Looks like we need a function which does the copy of the attributes in a more
reasonible fashion. There might be other attributes which have a similar issue
too.

Reply via email to