From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 124896 invoked by alias); 20 Dec 2018 12:09:54 -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 124881 invoked by uid 89); 20 Dec 2018 12:09:53 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-25.9 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=88521, r266355, x265, movss 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; Thu, 20 Dec 2018 12:09:51 +0000 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EDDAADA337; Thu, 20 Dec 2018 12:09:49 +0000 (UTC) Received: from tucnak.zalov.cz (ovpn-117-214.ams2.redhat.com [10.36.117.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 568E9600C0; Thu, 20 Dec 2018 12:09:49 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.15.2/8.15.2) with ESMTP id wBKC9l5k012976; Thu, 20 Dec 2018 13:09:47 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.15.2/8.15.2/Submit) id wBKC9i0U012974; Thu, 20 Dec 2018 13:09:44 +0100 Date: Thu, 20 Dec 2018 12:16:00 -0000 From: Jakub Jelinek To: Uros Bizjak , Lokesh Janghel Cc: mateuszb@poczta.onet.pl, gcc-patches@gcc.gnu.org Subject: Re: [Patch] Bug 88521 - gcc 9.0 from r266355 miscompile x265 for mingw-w64 target Message-ID: <20181220120944.GO23305@tucnak> Reply-To: Jakub Jelinek References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) X-IsSubscribed: yes X-SW-Source: 2018-12/txt/msg01456.txt.bz2 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. Jakub