From patchwork Fri Dec 6 19:35:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1205262 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-515373-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="XwsEmYOL"; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="AOMhuukV"; 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 47V2qS0xB2z9sPf for ; Sat, 7 Dec 2019 06:35:14 +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:to :from:subject:message-id:date:mime-version:content-type; q=dns; s=default; b=ScUGuCKbn604Ps7gAgQ7Cz3NEuDYn8yuWc9VrNLEuxBeZNjQLc rTkco2EwXcUu9M7trw3bJVX4H32mUrcEUsn8c4TNw7Q/6TLE2nBY2YeVziYYK0s7 PA86KyvrK/M4DgeH987F1AySW47fNBqqTDlq1z+0ZdP1T7J52m5IyCFog= 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:to :from:subject:message-id:date:mime-version:content-type; s= default; bh=NzPlalZr2vIgBuwQJk11ABEM32I=; b=XwsEmYOLICB5MK5yRhkW vjqCkQoETkiLBPhsjpdu8O5TRTtAqkQ7wvOzaucC3nbm9BKNrCgQK7tGlcLUQDcS xU671gR9eP7xCEoeF2b9CS4APluzLSL852Nm8/wbS1farZzZ4VsLBVLUTFyftHXb mJZupbG2THsIKUBfC5eUTqs= Received: (qmail 40163 invoked by alias); 6 Dec 2019 19:35:07 -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 40155 invoked by uid 89); 6 Dec 2019 19:35:07 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.8 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT, SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-1.mimecast.com Received: from us-smtp-delivery-1.mimecast.com (HELO us-smtp-1.mimecast.com) (205.139.110.120) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 06 Dec 2019 19:35:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1575660904; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type; bh=o4x2r+KSQrVU/x0B5HXRV7Uu27JasuM0GixOIzHA55U=; b=AOMhuukVz98fxpoxqZCTe+orsUhQsxq+WzLH6qRMTue4ew262VlgScmOu6OV4bSB9S1PHf YAv68mwqhnyhzElF/N5OxNNIkp6nFIs5FL0nA4kMXW7e4Ik0bY8BjJtwcVkME11YhkDXkg q0XFrn8xCI1thbfmZ9KE1QCgElPcVog= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-306-36hjVI6BPOiXOYbuaYjgyA-1; Fri, 06 Dec 2019 14:35:03 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 2A2D0801E76 for ; Fri, 6 Dec 2019 19:35:02 +0000 (UTC) Received: from [10.10.121.29] (ovpn-121-29.rdu2.redhat.com [10.10.121.29]) by smtp.corp.redhat.com (Postfix) with ESMTP id DD98B5C1D6 for ; Fri, 6 Dec 2019 19:35:01 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: Patch to fix PR92176 Message-ID: <37f3c810-8436-0cd1-b766-7e29f807a61c@redhat.com> Date: Fri, 6 Dec 2019 14:35:01 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92176 The patch was tested on i686, x86-64, and ppc64. Committed as r279061. Index: ChangeLog =================================================================== --- ChangeLog (revision 279060) +++ ChangeLog (working copy) @@ -1,3 +1,10 @@ +2019-12-06 Andreas Krebbel + Vladimir Makarov + + PR rtl-optimization/92176 + * lra.c (simplify_subreg_regno): Don't permit unconditional + changing mode for LRA too. + 2019-12-06 Richard Sandiford * target.h (TCTX_ALLOCATION, TCTX_DEALLOCATION, TCTX_EXCEPTIONS) Index: rtlanal.c =================================================================== --- rtlanal.c (revision 279060) +++ rtlanal.c (working copy) @@ -3951,9 +3951,7 @@ simplify_subreg_regno (unsigned int xreg /* Give the backend a chance to disallow the mode change. */ if (GET_MODE_CLASS (xmode) != MODE_COMPLEX_INT && GET_MODE_CLASS (xmode) != MODE_COMPLEX_FLOAT - && !REG_CAN_CHANGE_MODE_P (xregno, xmode, ymode) - /* We can use mode change in LRA for some transformations. */ - && ! lra_in_progress) + && !REG_CAN_CHANGE_MODE_P (xregno, xmode, ymode)) return -1; /* We shouldn't simplify stack-related registers. */ Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 279060) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,9 @@ +2019-12-06 Andreas Krebbel + Vladimir Makarov + + PR rtl-optimization/92176 + * gcc.target/s390/pr92176.c: New test. + 2019-12-06 Martin Sebor * gcc.dg/Wstringop-overflow-23.c: Use the correct argument type. Index: testsuite/gcc.target/s390/pr92176.c =================================================================== --- testsuite/gcc.target/s390/pr92176.c (nonexistent) +++ testsuite/gcc.target/s390/pr92176.c (working copy) @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O3 -march=z13 -mzarch" } */ + +int a = 5, b, c, d, g, h, k, l, m, o; +static int e[7]; +int *volatile i = &d; +long long j; + +short p(int f, int dummy) { + k = 0 != (*e = m); + j = 0; + for (; j < 59; j = j + 1) + *i |= b; + g = 1; + for (; g <= 4; g++) { + o = 0; + for (; o <= 4; o++) + i = (int * volatile)(long)l; + } + return 42; +} + +void +q() { + char *n = (char*)&b; + + (*n = a) == p(e[6], c); + for (; h;) + for (;;) + ; +} + +/* { dg-final { scan-assembler-not {(?n)^\tvsteb\t.+,0$} } } */