[Bug middle-end/45632] const function pointer propagation issues with inlining

2011-10-21 Thread jamborm at gcc dot gnu.org
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.


[Bug middle-end/45632] const function pointer propagation issues with inlining

2010-09-10 Thread andi-gcc at firstfloor dot org


--- Comment #1 from andi-gcc at firstfloor dot org  2010-09-10 08:50 ---
Created an attachment (id=21763)
 -- (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21763action=view)
testcase, compiled with -O3


-- 


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



[Bug middle-end/45632] const function pointer propagation issues with inlining

2010-09-10 Thread rguenth at gcc dot gnu dot org


-- 

rguenth at gcc dot gnu dot org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu dot
   ||org, hubicka at gcc dot gnu
   ||dot org, jamborm at gcc dot
   ||gnu dot org
   Severity|normal  |enhancement
   Keywords||missed-optimization


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