From patchwork Mon Jan 29 21:01:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aaron Sawdey X-Patchwork-Id: 867301 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-472214-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="GWosQo+U"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3zVhky5rn2z9s7s for ; Tue, 30 Jan 2018 08:01:30 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; q=dns; s=default; b=uzols VRdyQLokN7p03wTaZAcX2BWZXMfdO5Cf/635CazrbRNvupF3adcJLKKlsVjcj32Z xilyZF1H/3yw6g4AZy7/V8onxi9OtNgIovff2raV7KAeqjIeXLUOQLgXbVoZiANu F/0bIUEgCBOSIUZWZ+GNsN18Pbwidj9tgO9NeU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :subject:from:to:cc:date:content-type:mime-version :content-transfer-encoding:message-id; s=default; bh=Zdov3i7rQ36 dwoH4toS07E1svtQ=; b=GWosQo+UcMvXe298E0V+4wovVXbWq6v3HeFD094jnpA 4Sm6viJBA+YJiK7YYXre1V+FW4GSn0ppRVUrPmhc6krxKizVRMZeciUyPfbut+jD 8xVWb6uqS4sArxCpurm5MrZlNksNDpjV4LDDfzVgA7OIJiURYLc1NS1MrGeZWaMA = Received: (qmail 49449 invoked by alias); 29 Jan 2018 21:01:23 -0000 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 Received: (qmail 43787 invoked by uid 89); 29 Jan 2018 21:01:19 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-11.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RCVD_IN_DNSWL_LOW autolearn=ham version=3.3.2 spammy= X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 29 Jan 2018 21:01:17 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0TKxD5S043171 for ; Mon, 29 Jan 2018 16:01:16 -0500 Received: from e31.co.us.ibm.com (e31.co.us.ibm.com [32.97.110.149]) by mx0a-001b2d01.pphosted.com with ESMTP id 2ft5t6qe70-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Mon, 29 Jan 2018 16:01:15 -0500 Received: from localhost by e31.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 29 Jan 2018 14:01:15 -0700 Received: from b03cxnp07028.gho.boulder.ibm.com (9.17.130.15) by e31.co.us.ibm.com (192.168.1.131) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Mon, 29 Jan 2018 14:01:13 -0700 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0TL1Cfo11534834; Mon, 29 Jan 2018 14:01:12 -0700 Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9B41C6A041; Mon, 29 Jan 2018 14:01:12 -0700 (MST) Received: from ragesh3a (unknown [9.80.196.18]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP id 7806A6A043; Mon, 29 Jan 2018 14:01:11 -0700 (MST) Subject: [PATCH][PR debug/83758] look more carefully for internal_arg_pointer in vt_add_function_parameter() From: Aaron Sawdey To: gcc-patches@gcc.gnu.org Cc: aolivia@gcc.gnu.org, boger@us.ibm.com, richard.sandiford@linaro.org, Segher Boessenkool , ebotcazou@adacore.com, Bill Schmidt , ian@airs.com Date: Mon, 29 Jan 2018 15:01:10 -0600 Mime-Version: 1.0 X-TM-AS-GCONF: 00 x-cbid: 18012921-8235-0000-0000-00000CF0D75A X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00008450; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000248; SDB=6.00982203; UDB=6.00498021; IPR=6.00761485; BA=6.00005799; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00019274; XFM=3.00000015; UTC=2018-01-29 21:01:14 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18012921-8236-0000-0000-00003F75111C Message-Id: <1517259670.4150.19.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2018-01-29_11:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801290268 X-IsSubscribed: yes This bug appears to revolve around whether there is a canonical rtx for internal_arg_pointer in var-tracking. In vt_add_function_parameter() we currently have: static void vt_add_function_parameter (tree parm) { rtx decl_rtl = DECL_RTL_IF_SET (parm); rtx incoming = DECL_INCOMING_RTL (parm); tree decl; machine_mode mode; poly_int64 offset; dataflow_set *out; decl_or_value dv; if (TREE_CODE (parm) != PARM_DECL) return; if (!decl_rtl || !incoming) return; if (GET_MODE (decl_rtl) == BLKmode || GET_MODE (incoming) == BLKmode) return; /* If there is a DRAP register or a pseudo in internal_arg_pointer, rewrite the incoming location of parameters passed on the stack into MEMs based on the argument pointer, so that incoming doesn't depend on a pseudo. */ if (MEM_P (incoming) && (XEXP (incoming, 0) == crtl->args.internal_arg_pointer || (GET_CODE (XEXP (incoming, 0)) == PLUS && XEXP (XEXP (incoming, 0), 0) == crtl->args.internal_arg_pointer && CONST_INT_P (XEXP (XEXP (incoming, 0), 1))))) { HOST_WIDE_INT off = -FIRST_PARM_OFFSET (current_function_decl); if (GET_CODE (XEXP (incoming, 0)) == PLUS) off += INTVAL (XEXP (XEXP (incoming, 0), 1)); incoming = replace_equiv_address_nv (incoming, plus_constant (Pmode, arg_pointer_rtx, off)); } This is looking for crtl->args.internal_arg_pointer within rtx incoming. The problem I am seeing is that the same rtx is there, just not as a pointer to the identical rtx objects, so is not found by the == comparison in the current code. So hence my patch below to switch from == to rtx_equal_p(). If the expression is not rewritten, then the pseudo created for the stack pointer is not preserved and later we run into the assert near the beginning of vt_expand_var_loc_chain(). Bootstrap now passes for languages=c,c++,go on ppc64le. If bootstrap/regtest is ok on ppc64le and x86_64, ok for trunk? 2018-01-29 Aaron Sawdey * var-tracking.c (vt_add_function_parameter): Fix comparison of rtx. HOST_WIDE_INT off = -FIRST_PARM_OFFSET (current_function_decl); Index: gcc/var-tracking.c =================================================================== --- gcc/var-tracking.c (revision 257159) +++ gcc/var-tracking.c (working copy) @@ -9668,10 +9668,10 @@ into MEMs based on the argument pointer, so that incoming doesn't depend on a pseudo. */ if (MEM_P (incoming) - && (XEXP (incoming, 0) == crtl->args.internal_arg_pointer + && (rtx_equal_p (XEXP (incoming, 0), crtl- >args.internal_arg_pointer) || (GET_CODE (XEXP (incoming, 0)) == PLUS - && XEXP (XEXP (incoming, 0), 0) - == crtl->args.internal_arg_pointer + && rtx_equal_p (XEXP (XEXP (incoming, 0), 0), + crtl->args.internal_arg_pointer) && CONST_INT_P (XEXP (XEXP (incoming, 0), 1))))) {