On Fri, Apr 8, 2011 at 8:49 AM, Richard Guenther <rguent...@suse.de> wrote: > > This is the "real" fix for PR46076 that I wanted to persue. Make > function pointer type conversions useless as to more aggressively > be able to turn indirect into direct calls. This requires that we > preserve the original type signature of the called function as > presented by the frontend. The patch does that by adding a fntype > field to every call stmt in GIMPLE and extract this information > during gimplification. > > Bootstrapped on x86_64-unknown-linux-gnu, re-bootstrapping and > testing after a minor fix currently. > > I'll leave this for comments over the weekend, and if there are none > will go ahead and check this in early next week. > > Thanks, > Richard. > > 2011-04-08 Richard Guenther <rguent...@suse.de> > > PR tree-optimization/46076 > * gimple.h (struct gimple_statement_call): Add fntype field. > (gimple_call_fntype): Adjust. > (gimple_call_set_fntype): New function. > * gimple.c (gimple_build_call_1): Set the call function type. > * gimplify.c (gimplify_call_expr): Preserve the function > type the frontend used for the call. > (gimplify_modify_expr): Likewise. > * lto-streamer-in.c (input_gimple_stmt): Input the call stmts > function type. > * lto-streamer-out.c (output_gimple_stmt): Output the call stmts > function type. > * tree-ssa.c (useless_type_conversion_p): Function pointer > conversions are useless. >
This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=48584 -- H.J.