This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/84312] New: Variadic function without named argument not inlined
- From: "denis.campredon at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 09 Feb 2018 14:42:20 +0000
- Subject: [Bug tree-optimization/84312] New: Variadic function without named argument not inlined
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84312
Bug ID: 84312
Summary: Variadic function without named argument not inlined
Product: gcc
Version: unknown
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: tree-optimization
Assignee: unassigned at gcc dot gnu.org
Reporter: denis.campredon at gmail dot com
Target Milestone: ---
--------------------------------------
int a;
static inline void f2 (...) {a++;}
void f1 (void) { f2 (0); }
--------------------------------------
g++ with optimisations enabled inlines f2 only when f2 is empty or when it is
called with 0 arguments.
When compiled with -Winline the code above produces the following warning
which is I think wrong :
----------------------------------
main.cpp: In function 'void f1()':
main.cpp:3:20: warning: inlining failed in call to 'void f2(...)': mismatched
arguments [-Winline]
static inline void f2 (...) {a++;}
^~
main.cpp:4:21: note: called from here
void f1 (void) { f2 (0); }
~~~^~~
---------------------------------