[Bug middle-end/45632] const function pointer propagation issues with inlining
jamborm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Fri Oct 21 14:08:00 GMT 2011
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45632
--- Comment #2 from Martin Jambor <jamborm at gcc dot gnu.org> 2011-10-21 14:07:53 UTC ---
Is the second call to func() in main we pass the pointer p again, p2
being basically thrown away, I think that is a mistake because this
way, there isn't actually any call to b_foo in the testcase, just two
calls to a_foo.
BTW, currently (at -O3 and on i686) not even these calls to a_foo is
inlined. Just one of them is direct but the other one is not, presumably
because we don't believe in the constantness of *p over the first call
at this stage. When I change the testcase to pass p2 to the second
invocation of func, neither a_foo nor b_foo are inlined either.
So it seems to me that in order to inline both cases we'd need
aggregate return functions that we would be able to combine with
indirect cgraph edges at inlining time. Tough.
More information about the Gcc-bugs
mailing list