From patchwork Wed Mar 2 01:22:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hongyu Wang X-Patchwork-Id: 1599566 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.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=u6cnC23k; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K7bvt4nchz9sFs for ; Wed, 2 Mar 2022 12:22:48 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 259ED3858422 for ; Wed, 2 Mar 2022 01:22:45 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 259ED3858422 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1646184165; bh=kLe+3oHbTckhQgMCpaCY1Cql97K8k+g7sVV110m2Ylw=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=u6cnC23kYWGVvuNSulOzhidxNX8H5WwwA+hwUcVwFR9iv9e5EQtbNpgaiynyujLvW 2L8r9U6YzZr2TDFttJ/PegYnJpe8TkLsiDVojhMoeDpus0yVjpvUX5TDyOVqwfAW2B Dh5DdQsmt2jrGZ2a7n5WG2nI0h+2adp+N+HqSqcs= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by sourceware.org (Postfix) with ESMTPS id 421C53858D39 for ; Wed, 2 Mar 2022 01:22:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 421C53858D39 X-IronPort-AV: E=McAfee;i="6200,9189,10273"; a="250860226" X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="250860226" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Mar 2022 17:22:22 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.90,146,1643702400"; d="scan'208";a="609026757" Received: from scymds01.sc.intel.com ([10.148.94.138]) by fmsmga004.fm.intel.com with ESMTP; 01 Mar 2022 17:22:22 -0800 Received: from shliclel320.sh.intel.com (shliclel320.sh.intel.com [10.239.236.50]) by scymds01.sc.intel.com with ESMTP id 2221MLYW021473 for ; Tue, 1 Mar 2022 17:22:22 -0800 To: gcc-patches@gcc.gnu.org Subject: [PATCH] i386: Fix pr104551 testcase for solaris [PR 104726] Date: Wed, 2 Mar 2022 09:22:21 +0800 Message-Id: <20220302012221.31375-1-hongyu.wang@intel.com> X-Mailer: git-send-email 2.18.1 X-Spam-Status: No, score=-10.6 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_SHORT, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_SOFTFAIL, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Hongyu Wang via Gcc-patches From: Hongyu Wang Reply-To: Hongyu Wang Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Sender: "Gcc-patches" Use avx2-check mechanism to avoid illegal instrucion on non-avx2 target. Tested by Rainer Orth on Solaris/x86. Pushed to trunk as obvious fix. gcc/testsuite/ChangeLog: PR target/104726 * gcc.target/i386/pr104551.c: Use avx2-check.h. --- gcc/testsuite/gcc.target/i386/pr104551.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gcc/testsuite/gcc.target/i386/pr104551.c b/gcc/testsuite/gcc.target/i386/pr104551.c index 6300f25c0d5..b839d5b2b0d 100644 --- a/gcc/testsuite/gcc.target/i386/pr104551.c +++ b/gcc/testsuite/gcc.target/i386/pr104551.c @@ -2,6 +2,8 @@ /* { dg-options "-O3 -mavx2" } */ /* { dg-require-effective-target avx2 } */ +#include "avx2-check.h" + unsigned int __attribute__((noipa)) test(unsigned int a, unsigned char p[16]) { @@ -11,7 +13,8 @@ test(unsigned int a, unsigned char p[16]) { return res; } -int main () +static void +avx2_test (void) { unsigned int a = 16U; unsigned char p[16]; @@ -20,5 +23,4 @@ int main () unsigned int res = test (a, p); if (res != 128) __builtin_abort (); - return 0; }