This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/10971] New: Static function inlining fails in C99 mode
- From: "saptor at hotmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 25 May 2003 13:50:48 -0000
- Subject: [Bug optimization/10971] New: Static function inlining fails in C99 mode
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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.