On Thu, Mar 03, 2011 at 04:43:15PM +0100, Richard Guenther wrote: > On Thu, Mar 3, 2011 at 4:42 PM, Richard Guenther > <richard.guent...@gmail.com> wrote: > > On Thu, Mar 3, 2011 at 3:33 PM, Alan Modra <amo...@gmail.com> wrote: > >> TREE_ADDRESSABLE comment says "In a FUNCTION_DECL, nonzero means its > >> address is needed". However, as I point out in > >> http://gcc.gnu.org/ml/gcc-patches/2011-02/msg01525.html, this flag > >> gets set when making normal calls. It wasn't always like this. > >> gcc-4.0 was careful to not set TREE_ADDRESSABLE on FUNCTION_DECLs in > >> build_function_call, a feature lost in revision 100984. I'd like to > >> have that feature back for the above patch. Bootstrapped and > >> regression tested powerpc-linux. OK for 4.6? > > > > You'll get the addressable flag re-applied by the operand scanner.
Eh? I didn't see that happening. Are you confusing the FUNCTION_TYPE node with the FUNCTION_DECL? > The proper way to check "if its address is needed" is via cgraph > predicates. That was the first thing that occurred to me too. Then I noticed Breakpoint 1, init_cumulative_args (cum=0xffffe620, fntype=0xf7eee540, libname=0x0, incoming=1, libcall=0, n_named_args=1000, fndecl=0xf7f51100, return_mode=VOIDmode) at /home/alan/src/gcc-current/gcc/config/rs6000/rs6000.c:7896 (gdb) up #1 0x103c10a0 in assign_parms_initialize_all (all=0xffffe620) at /home/alan/src/gcc-current/gcc/function.c:2195 (gdb) #2 0x103c6bb4 in gimplify_parameters () at /home/alan/src/gcc-current/gcc/function.c:3576 (gdb) #3 0x1040fa88 in gimplify_body (body_p=0xf7f5115c, fndecl=0xf7f51100, do_parms=<value optimized out>) at /home/alan/src/gcc-current/gcc/gimplify.c:7706 (gdb) #4 0x1040fd64 in gimplify_function_tree (fndecl=0xf7f51100) at /home/alan/src/gcc-current/gcc/gimplify.c:7846 (gdb) #5 0x1076457c in cgraph_analyze_function (node=0xf7ed22b8) at /home/alan/src/gcc-current/gcc/cgraphunit.c:797 That scared me away from that idea. Hmm, I guess all I need to do is check cgraph node->analyzed. -- Alan Modra Australia Development Lab, IBM