From patchwork Fri Jul 8 07:11:39 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Bonzini X-Patchwork-Id: 103772 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 C102DB6F77 for ; Fri, 8 Jul 2011 17:12:05 +1000 (EST) Received: (qmail 8124 invoked by alias); 8 Jul 2011 07:12:01 -0000 Received: (qmail 8101 invoked by uid 22791); 8 Jul 2011 07:11:59 -0000 X-SWARE-Spam-Status: No, hits=-2.4 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, FREEMAIL_FROM, RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-wy0-f175.google.com (HELO mail-wy0-f175.google.com) (74.125.82.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Jul 2011 07:11:43 +0000 Received: by wyg30 with SMTP id 30so1384800wyg.20 for ; Fri, 08 Jul 2011 00:11:41 -0700 (PDT) Received: by 10.227.38.101 with SMTP id a37mr1470443wbe.36.1310109101895; Fri, 08 Jul 2011 00:11:41 -0700 (PDT) Received: from yakj.usersys.redhat.com (93-34-199-31.ip51.fastwebnet.it [93.34.199.31]) by mx.google.com with ESMTPS id fi5sm7454402wbb.5.2011.07.08.00.11.41 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 08 Jul 2011 00:11:41 -0700 (PDT) Message-ID: <4E16ADAB.4000409@gnu.org> Date: Fri, 08 Jul 2011 09:11:39 +0200 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110428 Fedora/3.1.10-1.fc15 Mnenhy/0.8.3 Thunderbird/3.1.10 MIME-Version: 1.0 To: GCC Patches , Richard Sandiford CC: Dimitrios Apostolou Subject: what can be in a group set? 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 df-scan.c has this code to deal with group sets: /* It is legal to have a set destination be a parallel. */ if (GET_CODE (dst) == PARALLEL) { int i; for (i = XVECLEN (dst, 0) - 1; i >= 0; i--) { rtx temp = XVECEXP (dst, 0, i); if (GET_CODE (temp) == EXPR_LIST || GET_CODE (temp) == CLOBBER || GET_CODE (temp) == SET) df_def_record_1 (collection_rec, temp, bb, insn_info, GET_CODE (temp) == CLOBBER ? flags | DF_REF_MUST_CLOBBER : flags); } return; } It seems to me that the case of (set (parallel [(set ...)])) and (set (parallel [(clobber ...)])) is bogus. I would like to simplify it to the following: /* It is legal to have a set destination be a parallel. */ if (GET_CODE (dst) == PARALLEL) { int i; for (i = XVECLEN (dst, 0) - 1; i >= 0; i--) { rtx temp = XVECEXP (dst, 0, i); assert (GET_CODE (temp) == EXPR_LIST); df_def_record_1 (collection_rec, temp, bb, insn_info, flags); } return; } Does this make sense? See the attached patch for the overall thing I was thinking of. Paolo * df-scan.c (df_def_record_1): Assert a parallel must contain an EXPR_LIST at this point. Receive the LOC and move its extraction... (df_defs_record): ... here. Remove superfluous braces. Index: df-scan.c =================================================================== --- df-scan.c (revision 169877) +++ df-scan.c (working copy) @@ -111,7 +111,7 @@ static void df_ref_record (enum df_ref_c rtx, rtx *, basic_block, struct df_insn_info *, enum df_ref_type, int ref_flags); -static void df_def_record_1 (struct df_collection_rec *, rtx, +static void df_def_record_1 (struct df_collection_rec *, rtx *, basic_block, struct df_insn_info *, int ref_flags); static void df_defs_record (struct df_collection_rec *, rtx, @@ -2922,19 +2922,10 @@ df_read_modify_subreg_p (rtx x) static void df_def_record_1 (struct df_collection_rec *collection_rec, - rtx x, basic_block bb, struct df_insn_info *insn_info, + rtx *loc, basic_block bb, struct df_insn_info *insn_info, int flags) { - rtx *loc; - rtx dst; - - /* We may recursively call ourselves on EXPR_LIST when dealing with PARALLEL - construct. */ - if (GET_CODE (x) == EXPR_LIST || GET_CODE (x) == CLOBBER) - loc = &XEXP (x, 0); - else - loc = &SET_DEST (x); - dst = *loc; + rtx dst = *loc; /* It is legal to have a set destination be a parallel. */ if (GET_CODE (dst) == PARALLEL) @@ -2944,12 +2935,9 @@ df_def_record_1 (struct df_collection_re for (i = XVECLEN (dst, 0) - 1; i >= 0; i--) { rtx temp = XVECEXP (dst, 0, i); - if (GET_CODE (temp) == EXPR_LIST || GET_CODE (temp) == CLOBBER - || GET_CODE (temp) == SET) - df_def_record_1 (collection_rec, - temp, bb, insn_info, - GET_CODE (temp) == CLOBBER - ? flags | DF_REF_MUST_CLOBBER : flags); + gcc_assert (GET_CODE (temp) == EXPR_LIST); + df_def_record_1 (collection_rec, &XEXP (temp, 0), + bb, insn_info, flags); } return; } @@ -3003,18 +2991,16 @@ df_defs_record (struct df_collection_rec { RTX_CODE code = GET_CODE (x); - if (code == SET || code == CLOBBER) - { - /* Mark the single def within the pattern. */ - int clobber_flags = flags; - clobber_flags |= (code == CLOBBER) ? DF_REF_MUST_CLOBBER : 0; - df_def_record_1 (collection_rec, x, bb, insn_info, clobber_flags); - } + if (code == SET) + df_def_record_1 (collection_rec, &SET_DEST (x), bb, insn_info, flags); + else if (code == CLOBBER) + { + flags |= DF_REF_MUST_CLOBBER; + df_def_record_1 (collection_rec, &XEXP (x, 0), bb, insn_info, flags); + } else if (code == COND_EXEC) - { - df_defs_record (collection_rec, COND_EXEC_CODE (x), - bb, insn_info, DF_REF_CONDITIONAL); - } + df_defs_record (collection_rec, COND_EXEC_CODE (x), + bb, insn_info, DF_REF_CONDITIONAL); else if (code == PARALLEL) { int i;