From patchwork Mon Jan 17 15:18:18 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Oliva X-Patchwork-Id: 79189 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 0F656B70A9 for ; Tue, 18 Jan 2011 02:18:35 +1100 (EST) Received: (qmail 20694 invoked by alias); 17 Jan 2011 15:18:32 -0000 Received: (qmail 20685 invoked by uid 22791); 17 Jan 2011 15:18:31 -0000 X-SWARE-Spam-Status: No, hits=-5.4 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, TW_NR, T_RP_MATCHES_RCVD, T_TVD_MIME_NO_HEADERS 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, 17 Jan 2011 15:18:26 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id p0HFIObU005119 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 17 Jan 2011 10:18:24 -0500 Received: from freie.oliva.athome.lsd.ic.unicamp.br (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id p0HFINs2021024 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 17 Jan 2011 10:18:24 -0500 Received: from livre.localdomain (livre-to-gw.oliva.athome.lsd.ic.unicamp.br [172.31.160.19]) by freie.oliva.athome.lsd.ic.unicamp.br (8.14.4/8.14.4) with ESMTP id p0HFIKQ1019157 for ; Mon, 17 Jan 2011 13:18:20 -0200 Received: from livre.localdomain (aoliva@localhost [127.0.0.1]) by livre.localdomain (8.14.3/8.14.3/Debian-5+lenny1) with ESMTP id p0HFIJHj001411; Mon, 17 Jan 2011 13:18:19 -0200 Received: (from aoliva@localhost) by livre.localdomain (8.14.3/8.14.3/Submit) id p0HFII3L001409; Mon, 17 Jan 2011 13:18:18 -0200 From: Alexandre Oliva To: gcc-patches@gcc.gnu.org Subject: [PR debug/47079] fix fallout from PR 46724 Date: Mon, 17 Jan 2011 13:18:18 -0200 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 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 The patch to better track variables merged with RESULT_DECLs because of NVR ended up regressing guality/nrv-1.c on x86 32-bit, because the RTL hadn't undergone register elimination, and still referenced virtual_incoming_args_rtx. This was not an issue on x86_64, because of different calling conventions. This patch makes sure var-tracking isn't handed RTL with virtual_incoming_args_rtx, and arranges for us to perform virtual register elimination on incoming rtl and on other decls referenced in DECL_VALUE_EXPR, which is enough for nrv-1 to pass again. Regstrapped on x86_64-linux-gnu and i686-linux-gnu. Ok? for gcc/ChangeLog from Alexandre Oliva PR debug/47079 PR debug/46724 * function.c (instantiate_expr): Instantiate incoming rtl of implicit arguments, and recurse on VALUE_EXPRs. (instantiate_decls): Instantiate rtl and VALUE_EXPR of result. * var-tracking.c (adjust_mems): Reject virtual_incoming_args_rtx. Index: gcc/function.c =================================================================== --- gcc/function.c.orig 2010-12-28 20:24:03.881770200 -0200 +++ gcc/function.c 2010-12-28 21:37:47.492920482 -0200 @@ -1784,8 +1784,21 @@ instantiate_expr (tree *tp, int *walk_su if (! EXPR_P (t)) { *walk_subtrees = 0; - if (DECL_P (t) && DECL_RTL_SET_P (t)) - instantiate_decl_rtl (DECL_RTL (t)); + if (DECL_P (t)) + { + if (DECL_RTL_SET_P (t)) + instantiate_decl_rtl (DECL_RTL (t)); + if (TREE_CODE (t) == PARM_DECL && DECL_NAMELESS (t) + && DECL_INCOMING_RTL (t)) + instantiate_decl_rtl (DECL_INCOMING_RTL (t)); + if ((TREE_CODE (t) == VAR_DECL + || TREE_CODE (t) == RESULT_DECL) + && DECL_HAS_VALUE_EXPR_P (t)) + { + tree v = DECL_VALUE_EXPR (t); + walk_tree (&v, instantiate_expr, NULL, NULL); + } + } } return NULL; } @@ -1835,6 +1848,18 @@ instantiate_decls (tree fndecl) } } + if ((decl = DECL_RESULT (fndecl)) + && TREE_CODE (decl) == RESULT_DECL) + { + if (DECL_RTL_SET_P (decl)) + instantiate_decl_rtl (DECL_RTL (decl)); + if (DECL_HAS_VALUE_EXPR_P (decl)) + { + tree v = DECL_VALUE_EXPR (decl); + walk_tree (&v, instantiate_expr, NULL, NULL); + } + } + /* Now process all variables defined in the function or its subblocks. */ instantiate_decls_1 (DECL_INITIAL (fndecl)); Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c.orig 2010-12-28 19:14:24.501730254 -0200 +++ gcc/var-tracking.c 2010-12-28 20:43:03.825871640 -0200 @@ -805,6 +805,7 @@ adjust_mems (rtx loc, const_rtx old_rtx, && hard_frame_pointer_adjustment != -1 && cfa_base_rtx) return compute_cfa_pointer (hard_frame_pointer_adjustment); + gcc_checking_assert (loc != virtual_incoming_args_rtx); return loc; case MEM: mem = loc;