This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug tree-optimization/84312] New: Variadic function without named argument not inlined


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); }
                  ~~~^~~
---------------------------------

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]