From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21506 invoked by alias); 7 Nov 2011 16:14:54 -0000 Received: (qmail 21491 invoked by uid 22791); 7 Nov 2011 16:14:52 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 07 Nov 2011 16:14:39 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id pA7GEdhx020695 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 7 Nov 2011 11:14:39 -0500 Received: from austin.quesejoda.com (vpn-10-58.rdu.redhat.com [10.11.10.58]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id pA7GEbM7022553; Mon, 7 Nov 2011 11:14:38 -0500 Message-ID: <4EB803EC.2050907@redhat.com> Date: Mon, 07 Nov 2011 16:23:00 -0000 From: Aldy Hernandez User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc14 Lightning/1.0b3pre Thunderbird/3.1.10 MIME-Version: 1.0 To: Richard Henderson CC: Richard Guenther , gcc-patches Subject: Re: [patch] 19/n: trans-mem: middle end/misc patches (LAST PATCH) References: <4EB2EC3F.6000908@redhat.com> <4EB6D797.4070309@redhat.com> <4EB80172.1010606@redhat.com> <4EB8028B.90408@redhat.com> In-Reply-To: <4EB8028B.90408@redhat.com> Content-Type: multipart/mixed; boundary="------------060802000301000208010201" 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-11/txt/msg00982.txt.bz2 This is a multi-part message in MIME format. --------------060802000301000208010201 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 725 On 11/07/11 08:08, Richard Henderson wrote: > On 11/07/2011 08:04 AM, Aldy Hernandez wrote: >> @@ -1812,6 +1844,8 @@ expand_call_stmt (gimple stmt) >> bool builtin_p; >> size_t i; >> >> + mark_transaction_restart_calls (stmt); >> + >> if (gimple_call_internal_p (stmt)) >> { >> expand_internal_call (stmt); > > You're calling it too early, Aldy. The call you're searching > for hasn't been generated yet. *blush* Whoops! And that's what happens when you post patches with "OK pending tests". Sorry, my machines are chugging along and I'm queuing up patches for testing... Trying to take advantage of Richi's time zone... TM tests all pass. Further tests are still going. OK pending tests? --------------060802000301000208010201 Content-Type: text/plain; name="tm-restart" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="tm-restart" Content-length: 3030 Index: ChangeLog.tm-merge =================================================================== --- ChangeLog.tm-merge (revision 181067) +++ ChangeLog.tm-merge (working copy) @@ -58,8 +58,10 @@ * calls.c (is_tm_builtin): New. (flags_from_decl_or_type): Add ECF_TM_OPS for TM clones. * cfgbuild.c (make_edges): Add edges for REG_TM notes. - * cfgexpand.c (expand_gimple_stmt): Add REG_TM notes. + * cfgexpand.c (expand_call_stmt): Call + mark_transaction_restart_calls. (gimple_expand_cfg): Free the tm_restart map. + (mark_transaction_restart_calls): New. * cfgrtl.c (purge_dead_edges): Look for REG_TM notes. * cgraph.c (dump_cgraph_node): Handle tm_clone. * cgraph.h (struct cgraph_node): Add tm_clone field. Index: cfgexpand.c =================================================================== --- cfgexpand.c (revision 181067) +++ cfgexpand.c (working copy) @@ -1802,6 +1802,38 @@ expand_gimple_cond (basic_block bb, gimp return new_bb; } +/* Mark all calls that can have a transaction restart. */ + +static void +mark_transaction_restart_calls (gimple stmt) +{ + struct tm_restart_node dummy; + void **slot; + + if (!cfun->gimple_df->tm_restart) + return; + + dummy.stmt = stmt; + slot = htab_find_slot (cfun->gimple_df->tm_restart, &dummy, NO_INSERT); + if (slot) + { + struct tm_restart_node *n = (struct tm_restart_node *) *slot; + tree list = n->label_or_list; + rtx insn; + + for (insn = next_real_insn (get_last_insn ()); + !CALL_P (insn); + insn = next_real_insn (insn)) + continue; + + if (TREE_CODE (list) == LABEL_DECL) + add_reg_note (insn, REG_TM, label_rtx (list)); + else + for (; list ; list = TREE_CHAIN (list)) + add_reg_note (insn, REG_TM, label_rtx (TREE_VALUE (list))); + } +} + /* A subroutine of expand_gimple_stmt_1, expanding one GIMPLE_CALL statement STMT. */ @@ -1888,6 +1920,8 @@ expand_call_stmt (gimple stmt) expand_assignment (lhs, exp, false); else expand_expr_real_1 (exp, const0_rtx, VOIDmode, EXPAND_NORMAL, NULL); + + mark_transaction_restart_calls (stmt); } /* A subroutine of expand_gimple_stmt, expanding one gimple statement @@ -2096,32 +2130,6 @@ expand_gimple_stmt (gimple stmt) } } - /* Mark all calls that can have a transaction restart. */ - if (cfun->gimple_df->tm_restart && is_gimple_call (stmt)) - { - struct tm_restart_node dummy; - void **slot; - - dummy.stmt = stmt; - slot = htab_find_slot (cfun->gimple_df->tm_restart, &dummy, NO_INSERT); - if (slot) - { - struct tm_restart_node *n = (struct tm_restart_node *) *slot; - tree list = n->label_or_list; - rtx insn; - - for (insn = next_real_insn (last); !CALL_P (insn); - insn = next_real_insn (insn)) - continue; - - if (TREE_CODE (list) == LABEL_DECL) - add_reg_note (insn, REG_TM, label_rtx (list)); - else - for (; list ; list = TREE_CHAIN (list)) - add_reg_note (insn, REG_TM, label_rtx (TREE_VALUE (list))); - } - } - return last; } --------------060802000301000208010201--