This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug lto/47205] GCC emits optimized out noinline function
- From: "hubicka at ucw dot cz" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 7 Jan 2011 12:47:26 +0000
- Subject: [Bug lto/47205] GCC emits optimized out noinline function
- Auto-submitted: auto-generated
- References: <bug-47205-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47205
--- Comment #1 from Jan Hubicka <hubicka at ucw dot cz> 2011-01-07 12:47:23 UTC ---
> extern int foo(void);
>
> int main(void)
> {
> return foo() * 0;
> }
This is because gimple part of optimizers for some reason leads to the
following in the optimized dump:
main ()
{
<bb 2>:
foo ();
return 0;
}
and only RTL optimizers do the trick.
This is weird since pure/const detect function as pure (seen in pure-const
dump)
Read info for foo/2 const nothrow
pure const state: const
previously known state: const
but tree-ssa-dce apparently fails to remove the statement. I guess it is
confused by lack of return value. I will take a look. But this is
tree-optimization bug.
Honza