From patchwork Thu Jul 20 04:50:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Liu, Hongtao" X-Patchwork-Id: 1810225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: legolas.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.a=rsa-sha256 header.s=default header.b=UEnHTti1; dkim-atps=neutral Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R60cY1N4tz1yYm for ; Thu, 20 Jul 2023 14:50:37 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C2A97385702B for ; Thu, 20 Jul 2023 04:50:34 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C2A97385702B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1689828634; bh=zw4uP5i8TnDrGdd8MQBp5gnilRagcjqmga5WXsSWwCs=; h=To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From:Reply-To:From; b=UEnHTti13aFsl8BJXkjQQ5v33t6JaAE97Tw3Bkd9/qLr1A4Zjnn1y0iTbSojbH1qK ixHpvqa+bEjv50O3UytWpyJ7ElzgSd1rKRx7qS+20+jtwDL9EELG3YGoi10abx3vTb juE+9ZgmA375Eh0+J4kmnBVRKeY1ABSOaukNGE+A= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by sourceware.org (Postfix) with ESMTPS id 91A233858C2B for ; Thu, 20 Jul 2023 04:50:13 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 91A233858C2B X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="351496665" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="351496665" Received: from fmsmga005.fm.intel.com ([10.253.24.32]) by orsmga106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 19 Jul 2023 21:50:12 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10776"; a="1055010789" X-IronPort-AV: E=Sophos;i="6.01,216,1684825200"; d="scan'208";a="1055010789" Received: from shvmail03.sh.intel.com ([10.239.245.20]) by fmsmga005.fm.intel.com with ESMTP; 19 Jul 2023 21:50:10 -0700 Received: from shliclel4217.sh.intel.com (shliclel4217.sh.intel.com [10.239.240.127]) by shvmail03.sh.intel.com (Postfix) with ESMTP id 95F7C1005692; Thu, 20 Jul 2023 12:50:09 +0800 (CST) To: gcc-patches@gcc.gnu.org Cc: jakub@redhat.com Subject: [PATCH] Fix fp16 related testcase failure for i686. Date: Thu, 20 Jul 2023 12:50:09 +0800 Message-Id: <20230720045009.989895-1-hongtao.liu@intel.com> X-Mailer: git-send-email 2.39.1.388.g2fc9e9ca3c In-Reply-To: References: MIME-Version: 1.0 X-Spam-Status: No, score=-12.0 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_SHORT, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: liuhongt via Gcc-patches From: "Liu, Hongtao" Reply-To: liuhongt Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" > I see some regressions most likely with this change on i686-linux, > in particular: > +FAIL: gcc.dg/pr107547.c (test for excess errors) > +FAIL: gcc.dg/torture/floatn-convert.c -O0 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O0 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O1 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O1 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 -flto (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 -flto compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O2 -flto -flto-partition=none (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O2 -flto -flto-partition=none compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O3 -fomit-frame-pointer -funroll-loops -fpeel-loops -ftracer -finline-functions compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -O3 -g (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -O3 -g compilation failed to produce executable > +FAIL: gcc.dg/torture/floatn-convert.c -Os (test for excess errors) > +UNRESOLVED: gcc.dg/torture/floatn-convert.c -Os compilation failed to produce executable > +FAIL: gcc.target/i386/float16-7.c (test for errors, line 7) > > Perhaps we need to tweak > gcc/testsuite/lib/target-supports.exp (add_options_for_float16) > so that it adds -msse2 for i?86-*-* x86_64-*-* (that would likely > fix up floatn-convert) and for the others perhaps > /* { dg-add-options float16 } */ > ? I've verified the change fixed those failures. Ready to push to trunk if there's no objections. gcc/testsuite/ChangeLog: * gcc.dg/pr107547.c: Add { dg-add-options float16 }. * gcc.target/i386/float16-7.c: Add -msse2 to dg-options. * lib/target-supports.exp (add_options_for_float16): Add -msse2 for i?86-*-* || x86_64-*-*. --- gcc/testsuite/gcc.dg/pr107547.c | 1 + gcc/testsuite/gcc.target/i386/float16-7.c | 2 +- gcc/testsuite/lib/target-supports.exp | 3 +++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/testsuite/gcc.dg/pr107547.c b/gcc/testsuite/gcc.dg/pr107547.c index c6992c8674b..7cd68afc0af 100644 --- a/gcc/testsuite/gcc.dg/pr107547.c +++ b/gcc/testsuite/gcc.dg/pr107547.c @@ -1,6 +1,7 @@ /* PR tree-optimization/107547 */ /* { dg-do compile } */ /* { dg-options "-O2" } */ +/* { dg-add-options float16 } */ int x; diff --git a/gcc/testsuite/gcc.target/i386/float16-7.c b/gcc/testsuite/gcc.target/i386/float16-7.c index 86641afeba9..660021b6ccc 100644 --- a/gcc/testsuite/gcc.target/i386/float16-7.c +++ b/gcc/testsuite/gcc.target/i386/float16-7.c @@ -1,5 +1,5 @@ /* { dg-do compile } */ -/* { dg-options "-O2 -mfpmath=387 -fexcess-precision=16" } */ +/* { dg-options "-O2 -msse2 -mfpmath=387 -fexcess-precision=16" } */ /* { dg-excess-errors "'-fexcess-precision=16' is not compatible with '-mfpmath=387'" } */ _Float16 foo (_Float16 a, _Float16 b) diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 8ea0d9feb1c..42024474091 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -3487,6 +3487,9 @@ proc add_options_for_float16 { flags } { if { [istarget arm*-*-*] } { return "$flags -mfp16-format=ieee" } + if { [istarget i?86-*-*] || [istarget x86_64-*-*] } { + return "$flags -msse2" + } return "$flags" }