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 optimization/10971] New: Static function inlining fails in C99 mode


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10971

           Summary: Static function inlining fails in C99 mode
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: optimization
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: saptor@hotmail.com
                CC: gcc-bugs@gcc.gnu.org

Sample code (test.c):

static inline
void foo()
{   
   int i;

   if (1)
   {
      if (1)
         ;
      else
         ;

      if (1)
         i = 1;
   }
}

int main()
{
   foo();

   return 0;
}

Produces this output from GCC when compiled with these settings:

$ gcc-3.3 -O -std=c99 -Winline test.c

test2.c: In function `main':
test2.c:3: warning: inlining failed in call to `foo'
test2.c:20: warning: called from here

Why did foo() fail to inline?  Changing the source by taking out an "if"
statement, the assignment at the end, or not using -std=c99 makes the warning go
away.



------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


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