From patchwork Tue Aug 20 09:17:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Botcazou X-Patchwork-Id: 1149939 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-507330-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=adacore.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="Chj84gJc"; 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 46CQFn5n1pz9s4Y for ; Tue, 20 Aug 2019 19:18:36 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; q=dns; s=default; b=iiJ25xyXc/iJs6ok rkEJi3Xyo0Y4gNZUg7MtV+CaN9mD0F7k2oi8iRi6n8Vt/HaFmNd3pKukmHpmmg/s t+V9p/qoeI61cAj55d76VfnaPcfUs0xIGO5gHRIOwGTLgISJwH5BR4b5lZrgzHaH wfs+OufqnaRT8AuzX7HUg1QG0gI= 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:from :to:subject:date:message-id:mime-version:content-type :content-transfer-encoding; s=default; bh=x8OxlR8u5Q1VMACUd1Apab 0WCcQ=; b=Chj84gJcGRQBZnrGPZopoArfqobHozSkr/EkUOTM1f2z7Ik1bXTtRl e7R5IFzoxBKipUQ86ykB6WX58LtylckF4nDCVp4XpvKMBhFbzoyuVi0E6IznUm96 8KmTawnWeqqEPZX7O6FOUGdEJ8Lg4pWNTJc15lEh+u8xFXVWO3JFE= Received: (qmail 18815 invoked by alias); 20 Aug 2019 09:18:28 -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 18798 invoked by uid 89); 20 Aug 2019 09:18:28 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-7.2 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, SPF_PASS autolearn=ham version=3.3.1 spammy=Dave X-HELO: smtp.eu.adacore.com Received: from mel.act-europe.fr (HELO smtp.eu.adacore.com) (194.98.77.210) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Aug 2019 09:18:26 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 8E9B78220C for ; Tue, 20 Aug 2019 11:18:23 +0200 (CEST) Received: from smtp.eu.adacore.com ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id RDBhaMfLcKEl for ; Tue, 20 Aug 2019 11:18:23 +0200 (CEST) Received: from arcturus.home (adijon-653-1-66-235.w90-33.abo.wanadoo.fr [90.33.137.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.eu.adacore.com (Postfix) with ESMTPSA id 5E58481C43 for ; Tue, 20 Aug 2019 11:18:23 +0200 (CEST) From: Eric Botcazou To: gcc-patches@gcc.gnu.org Subject: Fix PR rtl-optimization/91347 Date: Tue, 20 Aug 2019 11:17:50 +0200 Message-ID: <2193458.IskpPayDMY@arcturus.home> MIME-Version: 1.0 This is a regression present on all active branches: the compiler generates wrong code when tail cail optimization is used on the HPPA because the RTL DSE passes incorrectly deletes a live store. The fix completes the previous fix by Jakub for PR rtl-opt/55023 by extending the treatment applied to some tail calls before reload to all tail calls if HARD_FRAME_POINTER_IS_ARG_POINTER. Tested by Dave on HPPA/Linux, applied on all active branches. 2019-08-20 Eric Botcazou PR rtl-optimization/91347 * dse.c (scan_insn): Call add_wild_read for non-const/memset tail calls before reload if HARD_FRAME_POINTER_IS_ARG_POINTER. 2019-08-20 Eric Botcazou * gcc.c-torture/execute/20190820-1.c: New test. Index: dse.c =================================================================== --- dse.c (revision 274487) +++ dse.c (working copy) @@ -2537,10 +2537,13 @@ scan_insn (bb_info_t bb_info, rtx_insn *insn) clear_rhs_from_active_local_stores (); } } - else if (SIBLING_CALL_P (insn) && reload_completed) + else if (SIBLING_CALL_P (insn) + && (reload_completed || HARD_FRAME_POINTER_IS_ARG_POINTER)) /* Arguments for a sibling call that are pushed to memory are passed using the incoming argument pointer of the current function. After - reload that might be (and likely is) frame pointer based. */ + reload that might be (and likely is) frame pointer based. And, if + it is a frame pointer on the target, even before reload we need to + kill frame pointer based stores. */ add_wild_read (bb_info); else /* Every other call, including pure functions, may read any memory