This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/48837] Wrong optimization of recursive function calls
- From: "d.g.gorbachev at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Sun, 1 May 2011 07:31:35 +0000
- Subject: [Bug tree-optimization/48837] Wrong optimization of recursive function calls
- Auto-submitted: auto-generated
- References: <bug-48837-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48837
--- Comment #1 from Dmitry Gorbachev <d.g.gorbachev at gmail dot com> 2011-05-01 05:52:09 UTC ---
Simpler testcase:
=========================== 8< ===========================
__attribute__((noinline))
int baz(void)
{
return 1;
}
inline const int& bar(const int& a, const int& b)
{
return a ? a : b;
}
int foo(int a, int b)
{
return a || b ? baz() : foo(bar(a, b), 1) + foo(1, 0);
}
int main(void)
{
return foo(0, 0) != 2;
}
=========================== >8 ===========================