From patchwork Fri Mar 25 11:47:42 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nathan Froyd X-Patchwork-Id: 88376 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 5035B1007D1 for ; Fri, 25 Mar 2011 22:47:53 +1100 (EST) Received: (qmail 3885 invoked by alias); 25 Mar 2011 11:47:51 -0000 Received: (qmail 3874 invoked by uid 22791); 25 Mar 2011 11:47:51 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Mar 2011 11:47:46 +0000 Received: (qmail 20575 invoked from network); 25 Mar 2011 11:47:45 -0000 Received: from unknown (HELO codesourcery.com) (froydnj@127.0.0.2) by mail.codesourcery.com with ESMTPA; 25 Mar 2011 11:47:45 -0000 Date: Fri, 25 Mar 2011 07:47:42 -0400 From: Nathan Froyd To: gcc-patches@gcc.gnu.org Subject: [PATCH] fix PR bootstrap/48282 Message-ID: <20110325114741.GA31947@nightcrawler> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org I've applied the obvious patch below to fix PR bootstrap/48282. -Nathan PR bootstrap/4828 Revert: 2011-03-24 Nathan Froyd * function.c (instantiate_virtual_regs): Use FOR_EACH_BB and FOR_BB_INSNS_SAFE to iterate through insns. Re-indent. (pass_instantiate_virtual_regs): Require PROP_cfglayout. * passes.c (init_optimization_passes): Move pass_instantiate_virtual_regs after pass_into_cfg_layout_mode. Index: function.c =================================================================== --- function.c (revision 171446) +++ function.c (working copy) @@ -1883,7 +1883,7 @@ instantiate_decls (tree fndecl) static unsigned int instantiate_virtual_regs (void) { - basic_block bb; + rtx insn; /* Compute the offsets to use for this function. */ in_arg_offset = FIRST_PARM_OFFSET (current_function_decl); @@ -1901,40 +1901,33 @@ instantiate_virtual_regs (void) /* Scan through all the insns, instantiating every virtual register still present. */ - FOR_EACH_BB (bb) - { - rtx insn, curr; - - FOR_BB_INSNS_SAFE (bb, insn, curr) - { - if (INSN_P (insn)) - { - /* These patterns in the instruction stream can never be recognized. - Fortunately, they shouldn't contain virtual registers either. */ - if (GET_CODE (PATTERN (insn)) == USE - || GET_CODE (PATTERN (insn)) == CLOBBER - || GET_CODE (PATTERN (insn)) == ADDR_VEC - || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC - || GET_CODE (PATTERN (insn)) == ASM_INPUT) - continue; - else if (DEBUG_INSN_P (insn)) - for_each_rtx (&INSN_VAR_LOCATION (insn), - instantiate_virtual_regs_in_rtx, NULL); - else - instantiate_virtual_regs_in_insn (insn); + for (insn = get_insns (); insn; insn = NEXT_INSN (insn)) + if (INSN_P (insn)) + { + /* These patterns in the instruction stream can never be recognized. + Fortunately, they shouldn't contain virtual registers either. */ + if (GET_CODE (PATTERN (insn)) == USE + || GET_CODE (PATTERN (insn)) == CLOBBER + || GET_CODE (PATTERN (insn)) == ADDR_VEC + || GET_CODE (PATTERN (insn)) == ADDR_DIFF_VEC + || GET_CODE (PATTERN (insn)) == ASM_INPUT) + continue; + else if (DEBUG_INSN_P (insn)) + for_each_rtx (&INSN_VAR_LOCATION (insn), + instantiate_virtual_regs_in_rtx, NULL); + else + instantiate_virtual_regs_in_insn (insn); - if (INSN_DELETED_P (insn)) - continue; + if (INSN_DELETED_P (insn)) + continue; - for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL); + for_each_rtx (®_NOTES (insn), instantiate_virtual_regs_in_rtx, NULL); - /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ - if (CALL_P (insn)) - for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn), - instantiate_virtual_regs_in_rtx, NULL); - } - } - } + /* Instantiate any virtual registers in CALL_INSN_FUNCTION_USAGE. */ + if (CALL_P (insn)) + for_each_rtx (&CALL_INSN_FUNCTION_USAGE (insn), + instantiate_virtual_regs_in_rtx, NULL); + } /* Instantiate the virtual registers in the DECLs for debugging purposes. */ instantiate_decls (current_function_decl); @@ -1970,7 +1963,7 @@ struct rtl_opt_pass pass_instantiate_vir NULL, /* next */ 0, /* static_pass_number */ TV_NONE, /* tv_id */ - PROP_cfglayout, /* properties_required */ + 0, /* properties_required */ 0, /* properties_provided */ 0, /* properties_destroyed */ 0, /* todo_flags_start */ Index: passes.c =================================================================== --- passes.c (revision 171446) +++ passes.c (working copy) @@ -956,8 +956,8 @@ init_optimization_passes (void) NEXT_PASS (pass_rtl_eh); NEXT_PASS (pass_initial_value_sets); NEXT_PASS (pass_unshare_all_rtl); - NEXT_PASS (pass_into_cfg_layout_mode); NEXT_PASS (pass_instantiate_virtual_regs); + NEXT_PASS (pass_into_cfg_layout_mode); NEXT_PASS (pass_jump2); NEXT_PASS (pass_lower_subreg); NEXT_PASS (pass_df_initialize_opt);