From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8582 invoked by alias); 21 Dec 2018 09:08:25 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 8562 invoked by uid 89); 21 Dec 2018 09:08:25 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=HX-Gm-Message-State:sk:AJcUuke, Lokesh, lokesh, H*f:sk:MJPx_MP X-HELO: mail-io1-f66.google.com Received: from mail-io1-f66.google.com (HELO mail-io1-f66.google.com) (209.85.166.66) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 21 Dec 2018 09:08:22 +0000 Received: by mail-io1-f66.google.com with SMTP id v10so3009011ios.13 for ; Fri, 21 Dec 2018 01:08:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=9K9QFOTpocnD4fFj75mbqp4PO2YzZ/3aLN+gRO0Sv7w=; b=pTXAfiWNCaq3TbMDBT5E/vCobIIczdtendrjUbax8NvxjDdOS662GSPJMEbQ3RtKcU kO4R1EZjTh8h1QyNAJMnpcE/UcJCc7u6IgPAgAo2o67hDHdA1VeiiFzQKY+zyDwnX/lL pgIMN4K51gKAKzsJlZQeIEmT/ppvfUauFnA4XZpb6hc2DNFEgtVN7nQNIlAQrVcSVvwi AwsAGBHnep/d1hD+VwUTxcLw+MWO8cdBBuQjfSKVzXqqd2OcCUhvcy1Ety3pI3pi8SW0 c2nBazjdK7J9XYV0JTCi/5wA8TUdpH/skgKbdKhhfICv7pON0XtnTMF1W8Sp3GWeH3M5 BBTA== MIME-Version: 1.0 References: <20181220120944.GO23305@tucnak> In-Reply-To: <20181220120944.GO23305@tucnak> From: Uros Bizjak Date: Fri, 21 Dec 2018 09:14:00 -0000 Message-ID: Subject: Re: [Patch] Bug 88521 - gcc 9.0 from r266355 miscompile x265 for mingw-w64 target To: Jakub Jelinek Cc: Lokesh Janghel , mateuszb@poczta.onet.pl, "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-SW-Source: 2018-12/txt/msg01541.txt.bz2 On Thu, Dec 20, 2018 at 1:09 PM Jakub Jelinek wrote: > > On Thu, Dec 20, 2018 at 01:42:15PM +0530, Lokesh Janghel wrote: > > Hi Mateuszb, > > > > I tested with your proposition patch and it is working right. > > I also added the patch with test case. > > Please let me know your thoughts/suggestions. > > ChangeLog entry is missing, please write it (and mention there > Mateusz's name/mail as he wrote the i386.c part). > > diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c > index b3c8676..e54c489 100644 > --- a/gcc/config/i386/i386.c > +++ b/gcc/config/i386/i386.c > @@ -9063,6 +9063,13 @@ function_value_ms_64 (machine_mode orig_mode, machine_mode mode, > && !COMPLEX_MODE_P (mode)) > regno = FIRST_SSE_REG; > break; > + case 8: > + case 4: > + if (valtype != NULL_TREE && AGGREGATE_TYPE_P (valtype)) > + break; > + if (mode == SFmode || mode == DFmode) > + regno = FIRST_SSE_REG; > + break; > default: > break; > } > diff --git a/gcc/testsuite/gcc.target/i386/pr88521.c b/gcc/testsuite/gcc.target/i386/pr88521.c > new file mode 100644 > index 0000000..f42703a > --- /dev/null > +++ b/gcc/testsuite/gcc.target/i386/pr88521.c > @@ -0,0 +1,30 @@ > +/* { dg-do compile { target lp64 } } */ > +/* { dg-options "-O2" } */ > +/* { dg-final { scan-assembler-times "movl\[^\n\r]*, %eax|mov\[ \t]*eax," 1 } } */ > > You try here to handle both -masm=att and -masm=intel > > +/* { dg-final { scan-assembler-times "movss\[^\n\r]*, %xmm" 1 } } */ > +/* { dg-final { scan-assembler-times "movsd\[^\n\r]*, %xmm" 1 } } */ > > but not here. For that it would need to be "movss\[^\n\r]*(?:, %xmm|xmm, )" > and similarly for movsd (please verify with > make check-gcc RUNTESTFLAGS='--target_board=unix\{-m32/-masm=att,-m32/-masm=intel,-m64/-masm=att,-m64/-masm=intel\} i386.exp=pr88521.c' > > I'll defer the final review to Uros. This patch should be reviewed and evenutually approved by cygwin/mingw maintainer. Uros.