From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 700 invoked by alias); 11 Jun 2011 16:15:20 -0000 Received: (qmail 682 invoked by uid 22791); 11 Jun 2011 16:15:18 -0000 X-SWARE-Spam-Status: No, hits=-1.0 required=5.0 tests=AWL,BAYES_50,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,RFC_ABUSE_POST X-Spam-Check-By: sourceware.org Received: from mail-qy0-f175.google.com (HELO mail-qy0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 11 Jun 2011 16:15:03 +0000 Received: by qyk35 with SMTP id 35so314732qyk.20 for ; Sat, 11 Jun 2011 09:15:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.224.179.203 with SMTP id br11mr2600412qab.197.1307808902268; Sat, 11 Jun 2011 09:15:02 -0700 (PDT) Received: by 10.229.47.78 with HTTP; Sat, 11 Jun 2011 09:15:02 -0700 (PDT) In-Reply-To: <20110611125552.GA25068@kam.mff.cuni.cz> References: <20110611125552.GA25068@kam.mff.cuni.cz> Date: Sat, 11 Jun 2011 17:31:00 -0000 Message-ID: Subject: Re: Cgraph alias reorg 15/14 (New infrastructure for same body aliases) From: "H.J. Lu" To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-06/txt/msg00920.txt.bz2 On Sat, Jun 11, 2011 at 5:55 AM, Jan Hubicka wrote: > Hi, > this patch complettes the same body alias rework by removing the old same= body > alias code and adding new representation. =A0Same body aliases are now se= parate > function nodes that have IPA_REF_ALIAS reference to the node they are ali= as of. > > I am still getting one failure: > FAIL: g++.dg/torture/pr43879-1_1.C > > It tests IPA PTA in presence of same body aliases. =A0I honestly have no = idea > what is wrong there. =A0I decided to go ahead with the patch anyway, give= n the > current state of affair of aliases and IPA-PTA. Hope Richard will help me > fixing this on Monday. > > The major pain with this change is that C++ FE gets same body aliases wro= ng. > It creates them with random visibilities that are not final ones, it also > creates them late in game via DECL_ASSEMBLER_NAME langhook, it forgets to= set > them same_comdat_group links and it do not set DECLARED_INLINE and > DISREGARD_INLINE_LIMITS flags. > > I fix that up at cgraphunit side for now, but it would be cool to resolve= those > problems. > > I will followup with two extra fixes needed to fully build Mozilla with L= TO > again. =A0Once things settle down, I will switch real aliases to the new > infrastructure, too. > > Bootstrapped/regtested x86_64-linux, will commit it today. > > > =A0 =A0 =A0 =A0* lto-symtab.c (lto_cgraph_replace_node): Kill same body a= lias code. > =A0 =A0 =A0 =A0(lto_symtab_resolve_can_prevail_p): Likewise. > =A0 =A0 =A0 =A0(lto_symtab_merge_cgraph_nodes): Update merging of aliases. > =A0 =A0 =A0 =A0* cgraph.c (same_body_aliases_done): New global var. > =A0 =A0 =A0 =A0(cgraph_same_body_alias_1): Rename to ... > =A0 =A0 =A0 =A0(cgraph_create_function_alias): ... this one; reorg to new > =A0 =A0 =A0 =A0representation. > =A0 =A0 =A0 =A0(cgraph_same_body_alias): Use cgraph_create_function_alias; > =A0 =A0 =A0 =A0record references when asked to. > =A0 =A0 =A0 =A0(cgraph_add_thunk): Fix formating. > =A0 =A0 =A0 =A0(cgraph_get_node): Kill same body alias code. > =A0 =A0 =A0 =A0(cgraph_node_for_asm): Likewise. > =A0 =A0 =A0 =A0(cgraph_remove_same_body_alias): Remove. > =A0 =A0 =A0 =A0(cgraph_remove_node): Kill same body alias code. > =A0 =A0 =A0 =A0(cgraph_mark_address_taken_node): Mark also the aliased fu= nction > =A0 =A0 =A0 =A0as having address taken. > =A0 =A0 =A0 =A0(dump_cgraph_node): Dump same body aliases. > =A0 =A0 =A0 =A0(cgraph_for_node_thunks_and_aliases): Update for new alias > =A0 =A0 =A0 =A0representation. > =A0 =A0 =A0 =A0(cgraph_for_node_and_aliases): Likewise. > =A0 =A0 =A0 =A0* cgraph.h (same_body): Kll pointer. > =A0 =A0 =A0 =A0(same_body_alias): Update comment. > =A0 =A0 =A0 =A0(same_body_aliases_done): Declare. > =A0 =A0 =A0 =A0(cgraph_remove_same_body_alias): Remove declaration. > =A0 =A0 =A0 =A0(cgraph_create_function_alias): Declare. > =A0 =A0 =A0 =A0(cgraph_process_same_body_aliases): Declare. > =A0 =A0 =A0 =A0(cgraph_function_with_gimple_body_p): Check for alias. > =A0 =A0 =A0 =A0(cgraph_can_remove_if_no_direct_calls_p): Look for aliases. > =A0 =A0 =A0 =A0(cgraph_alias_aliased_node): New function. > =A0 =A0 =A0 =A0(cgraph_function_node): Update for new aliases. > =A0 =A0 =A0 =A0(cgraph_function_or_thunk_node): Likewise. > =A0 =A0 =A0 =A0* ipa-inline-transform.c (can_remove_node_now_p): Look for= aliases. > =A0 =A0 =A0 =A0(inline_call): Remove dead aliases. > =A0 =A0 =A0 =A0* cgraphunit.c (cgraph_decide_is_function_needed): Disable= assembler name > =A0 =A0 =A0 =A0hack for same body aliases. > =A0 =A0 =A0 =A0(clone_of_p): Look through aliases. > =A0 =A0 =A0 =A0(verify_cgraph_node): Verify aliases. > =A0 =A0 =A0 =A0(cgraph_analyze_function): Analyze aliases; fixup C++ bugs. > =A0 =A0 =A0 =A0(cgraph_process_same_body_aliases): New function. > =A0 =A0 =A0 =A0(process_function_and_variable_attributes): Disable weakre= f warning on > =A0 =A0 =A0 =A0alias. > =A0 =A0 =A0 =A0(cgraph_analyze_functions): Handle aliases. > =A0 =A0 =A0 =A0(cgraph_mark_functions_to_output): Handle aliases same way= as thunks. > =A0 =A0 =A0 =A0(assemble_thunks): Rename to ... > =A0 =A0 =A0 =A0(assemble_thunks_and_aliases): ... this one; handle aliase= s, too. > =A0 =A0 =A0 =A0(cgraph_expand_function): Remove alias output code. > =A0 =A0 =A0 =A0(cgraph_output_in_order): Skip aliases. > =A0 =A0 =A0 =A0(cgraph_preserve_function_body_p): Aliases don't need pres= erving. > =A0 =A0 =A0 =A0* ipa-ref.c (ipa_ref_use_name): Add alias reference. > =A0 =A0 =A0 =A0(ipa_record_reference): Do not assert on alias references. > =A0 =A0 =A0 =A0(ipa_ref_has_aliases_p): New function. > =A0 =A0 =A0 =A0* ipa-ref.h (enum ipa_ref_use): Add IPA_REF_ALIAS. > =A0 =A0 =A0 =A0(ipa_ref_has_aliases_p): Declare. > =A0 =A0 =A0 =A0* lto-cgraph.c (lto_output_node): Handle aliases. > =A0 =A0 =A0 =A0(input_node): Likewise. > =A0 =A0 =A0 =A0* lto-streamer-out.c (lto_output): Skip aliases. > =A0 =A0 =A0 =A0(produce_symtab): Kill same_body_alias code. > =A0 =A0 =A0 =A0* ipa-utils.c (ipa_reverse_postorder): Add FIXME. > =A0 =A0 =A0 =A0(ipa_reverse_postorder): Use cgraph_only_called_directly_o= r_aliased_p. > =A0 =A0 =A0 =A0* ipa-inline.c (update_caller_keys): Walk aliases. > =A0 =A0 =A0 =A0(inline_small_functions): Fix thinko in previous patch. > =A0 =A0 =A0 =A0* ipa.c (cgraph_externally_visible_p): Do not walk aliases. > =A0 =A0 =A0 =A0(function_and_variable_visibility): Do not walk same body = aliases. > =A0 =A0 =A0 =A0* tree-ssa-structalias.c (associate_varinfo_to_alias): New= function. > =A0 =A0 =A0 =A0(ipa_pta_execute): Use it. > > =A0 =A0 =A0 =A0* lto.c (add_cgraph_node_to_partition_1): Break out from .= .. > =A0 =A0 =A0 =A0(add_cgraph_node_to_partition) ... here; walk aliases. > =A0 =A0 =A0 =A0(lto_1_to_1_map): Remove same body alias code. > =A0 =A0 =A0 =A0(promote_fn): Likewise. > =A0 =A0 =A0 =A0(lto_promote_cross_file_statics): Update comment. > > =A0 =A0 =A0 =A0* decl2.c (cp_write_global_declarations): Process aliases;= look trhough > =A0 =A0 =A0 =A0same body aliases. This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D49373 --=20 H.J.