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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2026-11-12

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
One issue will likely be ipa-inline.cc:can_inline_edge_by_limits_p doing

      /* When user added an attribute to the callee honor it.  */
      else if (lookup_attribute ("optimize", DECL_ATTRIBUTES (callee->decl))
               && opts_for_fn (caller->decl) != opts_for_fn (callee->decl))
        {
          e->inline_failed = CIF_OPTIMIZATION_MISMATCH;
          inlinable = false;

where this relies on OPTIMIZATION_NODE merging only but comparing PerFunction
flags would result in code generation (inlining) differences.

The following is already problematic:

      /* If explicit optimize attribute are not used, the mismatch is caused
         by different command line options used to build different units.
         Do not care about COMDAT functions - those are intended to be
         optimized with the optimization flags of module they are used in.
         Also do not care about mixing up size/speed optimization when
         DECL_DISREGARD_INLINE_LIMITS is set.  */
      else if ((callee->merged_comdat
                && !lookup_attribute ("optimize",
                                      DECL_ATTRIBUTES (caller->decl)))
               || DECL_DISREGARD_INLINE_LIMITS (callee->decl))
        ;

because it does not disregard PerFunction.

So this area looks "incomplete".

Reply via email to