[Bug c++/85012] GCC does not inline extern "C" functions defined in a different namespace

rguenth at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Mar 21 08:58:00 GMT 2018


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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2018-03-21
                 CC|                            |hubicka at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> ---
While the C++ FE correctly diagnoses mismatches in the types of both it
represents them as different unrelated function decls so the middle-end doesn't
know they are the same (apart from sharing the asm name).  Not sure if it is
the FE that should behave differently here or whether the symtab code should
have identified those functions as refering to each other for inlining
(I guess it behaves similar to fndecls with __asm__() declarator which we
do not inline on purpose...)

 Final Symbol table:

f/3 (void foo::f()) @0x7f36ace36450
  Type: function
  Visibility: external public
  previous sharing asm name: 0
  References:
  Referring:
  Availability: not_available
  First run: 0
  Function flags:
  Called by:
  Calls:
_Z2f2v/2 (void f2()) @0x7f36ace362e0
  Type: function definition analyzed
  Visibility: externally_visible asm_written public
  References:
  Referring:
  Availability: available
  First run: 0
  Function flags: icf_merged nonfreeing_fn
  Called by:
  Calls:
_Z2f1v/1 (void f1()) @0x7f36ace36170
  Type: function definition analyzed
  Visibility: externally_visible asm_written public
  References:
  Referring:
  Availability: available
  First run: 0
  Function flags:
  Called by:
  Calls:
f/0 (void f()) @0x7f36ace36000
  Type: function definition analyzed
  Visibility: externally_visible asm_written public
  next sharing asm name: 3
  References:
  Referring:
  Availability: available
  First run: 0
  Function flags: icf_merged nonfreeing_fn
  Called by:
  Calls:


More information about the Gcc-bugs mailing list