From patchwork Tue Nov 19 16:07:44 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 1197524 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-514050-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (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="uTODMRQI"; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.b="YCniGD3v"; 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 47HW266rXJz9s4Y for ; Wed, 20 Nov 2019 03:07:58 +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=JvMrnGb2nhHUTTdLVGJXq6nKKzMrPwUsVnpwN1SgxxnECCpyNg U0a3MqBVTzuUZ/+xxbb9cZc5okw6LBB9EwcMJu4wI6ALl4WiX532UAOaA1RD8nIA dNz/PRgrRqpFSZGV5zNhYB8cUhDJB40I4fzjywe6ombzRjYiyUup6hZYc= 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=wnxVbCbY03Y2thguZCqQyEpDwuM=; b=uTODMRQIH3dUbITwiyFe f8ukSueWpxUiwz1OZHB2ZY6wdehmgO5l9NuBZvwp9TeMQ7lbTAmf4w2MG8F2KbKR TA5LsKz3bujO/bolAi58re20P/jFQu40YUZpdFioudyT/IrV7OWt6YltmwwUsLGW aOzCALOPoYagqkasnO4gPF4= Received: (qmail 126433 invoked by alias); 19 Nov 2019 16:07:51 -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 126424 invoked by uid 89); 19 Nov 2019 16:07:51 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-8.9 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT autolearn=ham version=3.3.1 spammy= X-HELO: us-smtp-delivery-1.mimecast.com Received: from us-smtp-2.mimecast.com (HELO us-smtp-delivery-1.mimecast.com) (207.211.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 19 Nov 2019 16:07:49 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1574179668; 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=xAxNYh0zlEpUQW69bKPkODdarbVJGWQkXJTVYEg/p10=; b=YCniGD3voxTn6wG2LnqKnm+XSmJoV9185+H916Pp1j95lwNAknuvhGbxRCOk0l0Q8qwI42 nnXZGc7VeECnmA6le05m/3EdtceJOcAozrZmGAJ1y1mKdNhsxjpzVfqnZfww2mMFLRq6aU /qmz+SfxcC0gj8uSTeizTHrkggVS4R0= 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-413-2iqClK13NdC0OAXGjpqQHw-1; Tue, 19 Nov 2019 11:07:46 -0500 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4C738DB21 for ; Tue, 19 Nov 2019 16:07:45 +0000 (UTC) Received: from tobol.usersys.redhat.com (unused-10-15-17-174.yyz.redhat.com [10.15.17.174]) by smtp.corp.redhat.com (Postfix) with ESMTP id 1FBF05E24F for ; Tue, 19 Nov 2019 16:07:44 +0000 (UTC) To: gcc-patches From: Vladimir Makarov Subject: RFA; patch to fix PR90007 Message-ID: Date: Tue, 19 Nov 2019 11:07:44 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.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=90007 Sometime ago a code which permits LRA to reload hard register into memory as it did for pseudo were added.  But this LRA possibility was not reflected in recog.c.  The following patch fixes this discrepancy and as a result fixes PR90007. OK to commit? Index: ChangeLog =================================================================== --- ChangeLog (revision 278451) +++ ChangeLog (working copy) @@ -1,3 +1,9 @@ +2019-11-19 Vladimir Makarov + + PR rtl-optimization/90007 + * recog.c (constrain_operands): Permit hard registers too for + memory when LRA is used. + 2019-11-19 Martin Liska * toplev.c (general_init): Move the call... Index: recog.c =================================================================== --- recog.c (revision 278413) +++ recog.c (working copy) @@ -2757,10 +2757,9 @@ constrain_operands (int strict, alternat /* Before reload, accept what reload can turn into a mem. */ || (strict < 0 && CONSTANT_P (op)) - /* Before reload, accept a pseudo, + /* Before reload, accept a pseudo or hard register, since LRA can turn it into a mem. */ - || (strict < 0 && targetm.lra_p () && REG_P (op) - && REGNO (op) >= FIRST_PSEUDO_REGISTER) + || (strict < 0 && targetm.lra_p () && REG_P (op)) /* During reload, accept a pseudo */ || (reload_in_progress && REG_P (op) && REGNO (op) >= FIRST_PSEUDO_REGISTER))) Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 278451) +++ testsuite/ChangeLog (working copy) @@ -1,3 +1,8 @@ +2019-11-19 Vladimir Makarov + + PR rtl-optimization/90007 + * gcc.target/i386/pr90007.c: New test. + 2019-11-15 Andrew Sutton PR c++/89913 Index: testsuite/gcc.target/i386/pr90007.c =================================================================== --- testsuite/gcc.target/i386/pr90007.c (nonexistent) +++ testsuite/gcc.target/i386/pr90007.c (working copy) @@ -0,0 +1,15 @@ +/* PR rtl-optimization/90007 */ +/* { dg-do compile { target x86_64-*-* } } */ +/* { dg-options "-march=bdver1 -mfpmath=387 -O1 -fschedule-insns -fselective-scheduling" } */ + +void +qj (int b9, int r9, int k4, int k0, int e7) +{ + (void) b9; + (void) r9; + (void) k4; + + while (!!k0 == e7 * 1.1) + { + } +}