From patchwork Fri Dec 8 23:50:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Vladimir Makarov X-Patchwork-Id: 846474 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-468833-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="XPc09puS"; 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 3ytpyZ5lTDz9sRm for ; Sat, 9 Dec 2017 10:50: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=fGmKuPmW2G3cQv6d5fKYafjPr8kU9QWc80RlXBzB2sQ66sl3fY fpGHWEEuW1ztMtc74qDM/6eGg2is8BAkKA6WjI5NSHaDAJZRyVUTxIVDFJVeIYT+ 39NmLebMh/SIHf5RU5M4bJjsJgmg7OyEPkfssOqt/RKmfr4/KGMBNElS4= 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=Twhu9Tyhiz+7719sEH89xyru5NY=; b=XPc09puSzIKdAZqJeeCx T5es7NYB+iZk2sFyIValRFGC/5dcS83OeI2CRyuvjIn8zY9kfxtDpG6eevlUSXzR fVI7YTiLfLNmhlzhbeJsm7iocQovS/8Y1IcVYW01l2vGAHH/HwpaLq+fYMTrmwEk MnZ2XSP1NcYZTWqyzNhjW4U= Received: (qmail 33795 invoked by alias); 8 Dec 2017 23:50: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 33779 invoked by uid 89); 8 Dec 2017 23:50:50 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-10.6 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_ASCII_DIVIDERS, KAM_NUMSUBJECT, KAM_SHORT, SPF_HELO_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 08 Dec 2017 23:50:49 +0000 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 039817E421 for ; Fri, 8 Dec 2017 23:50:48 +0000 (UTC) Received: from [10.10.121.10] (ovpn-121-10.rdu2.redhat.com [10.10.121.10]) by smtp.corp.redhat.com (Postfix) with ESMTP id 834AE17CD7 for ; Fri, 8 Dec 2017 23:50:47 +0000 (UTC) To: "gcc-patches@gcc.gnu.org" From: Vladimir Makarov Subject: patch to fix PR83317 Message-ID: Date: Fri, 8 Dec 2017 18:50:46 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 X-IsSubscribed: yes The following patch fixes https://gcc.gnu.org/bugzilla/show_bug.cgi?id=83317   The patch was successfully boostrapped and tested on x86-64.   Committed as rev. 255517 Index: ChangeLog =================================================================== --- ChangeLog (revision 255516) +++ ChangeLog (working copy) @@ -1,3 +1,8 @@ +2017-12-08 Vladimir Makarov + + PR rtl-optimization/83317 + * lra-constraints.c (process_address_1): Add insn code check. + 2017-12-08 Michael Matz Fix PR tree-optimization/83323 Index: lra-constraints.c =================================================================== --- lra-constraints.c (revision 255470) +++ lra-constraints.c (working copy) @@ -3222,7 +3222,8 @@ process_address_1 (int nop, bool check_o /* Do not attempt to decompose arbitrary addresses generated by combine for asm operands with loose constraints, e.g 'X'. */ else if (MEM_P (op) - && !(get_constraint_type (cn) == CT_FIXED_FORM + && !(INSN_CODE (curr_insn) < 0 + && get_constraint_type (cn) == CT_FIXED_FORM && constraint_satisfied_p (op, cn))) decompose_mem_address (&ad, op); else if (GET_CODE (op) == SUBREG Index: testsuite/ChangeLog =================================================================== --- testsuite/ChangeLog (revision 255516) +++ testsuite/ChangeLog (working copy) @@ -1,5 +1,10 @@ 2017-12-08 Jakub Jelinek + PR rtl-optimization/83317 + * gcc.target/i386/pr83317.c: New test. + +2017-12-08 Jakub Jelinek + PR rtl-optimization/81595 * gcc.c-torture/compile/pr81595.c: New test. Index: testsuite/gcc.target/i386/pr83317.c =================================================================== --- testsuite/gcc.target/i386/pr83317.c (nonexistent) +++ testsuite/gcc.target/i386/pr83317.c (working copy) @@ -0,0 +1,21 @@ +/* PR rtl-optimization/83317 */ +/* { dg-do compile } */ +/* { dg-options "-O1" } */ +/* { dg-additional-options "-fPIC" { target fpic } } */ +/* { dg-additional-options "-msse2 -mfpmath=sse" { target ia32 } } */ + +struct S { double a; }; +struct S c; +int d, e; +void *buf[64]; +extern int setjmp (void **); + +void +foo () +{ + setjmp (buf); + struct S g; + if (d) + g.a = __builtin_copysign (e, d); + c = g; +}