From patchwork Tue Feb 20 13:24:54 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Martin_Li=C5=A1ka?= X-Patchwork-Id: 875531 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-473595-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="y5cyg83o"; 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 3zm1ZC0903z9ryl for ; Wed, 21 Feb 2018 00:25:06 +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:from :subject:to:cc:message-id:date:mime-version:content-type; q=dns; s=default; b=V7lKbPKNcWac0jmgfaWiy+k62prneT4+jZw0eVhvZlf7/8zKjJ egTf3WPWnS+Gkt7QZOa9HgwyNY8kSWQyO/0yrMV04hcs3ZlR7XKYhYsNJACbAxOE fRjFFxRnG82EcjsoUoenazVPlI4MgCIaYSWZHFS0bIGHNyu6oTVOhH9w0= 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:from :subject:to:cc:message-id:date:mime-version:content-type; s= default; bh=J4wbi3u913Es6wCsmHKRcZWRjM0=; b=y5cyg83oFeLCRMur5lgA hlZYbb3+38MUSUSD/z97iwN68eCNkXf3y1/D7+y6YDzAKV6ZuU1TlIgV5fEXgMTY 9RJtrBEH1hcO335UZ8P7AEMrtLbsyCqV9E+itZ7+ipcXUPqmjKIoJaT9R5BBTzoI dzCDhtgxwQ68zf3EOt825ds= Received: (qmail 56396 invoked by alias); 20 Feb 2018 13:25:00 -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 56377 invoked by uid 89); 20 Feb 2018 13:24:59 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.9 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, SPF_PASS autolearn=ham version=3.3.2 spammy=nano X-HELO: mx2.suse.de Received: from mx2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 20 Feb 2018 13:24:58 +0000 Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 84330ACE9; Tue, 20 Feb 2018 13:24:55 +0000 (UTC) From: =?utf-8?q?Martin_Li=C5=A1ka?= Subject: [PATCH] Add "native" as a valid option value for -march= on i386 (PR driver/83193). To: gcc-patches@gcc.gnu.org Cc: Jakub Jelinek , Jan Hubicka Message-ID: Date: Tue, 20 Feb 2018 14:24:54 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 X-IsSubscribed: yes Hi. Following patch adds "native" as a possible option for -march value on i386 target. I have similar patches for other targets. Would it be possible to install the patch in current stage? Before: $ ./xgcc -B. -march=abcdef /tmp/empty.c cc1: error: bad value (‘abcdef’) for ‘-march=’ switch cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake bonnell atom silvermont slm knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 After: $ ./xgcc -B. -march=abcdef /tmp/empty.c cc1: error: bad value (‘abcdef’) for ‘-march=’ switch cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake bonnell atom silvermont slm knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 native $ ./xgcc -B. -march=native2 /tmp/empty.c cc1: error: bad value (‘native2’) for ‘-march=’ switch cc1: note: valid arguments to ‘-march=’ switch are: nocona core2 nehalem corei7 westmere sandybridge corei7-avx ivybridge core-avx-i haswell core-avx2 broadwell skylake skylake-avx512 cannonlake icelake bonnell atom silvermont slm knl knm x86-64 eden-x2 nano nano-1000 nano-2000 nano-3000 nano-x2 eden-x4 nano-x4 k8 k8-sse3 opteron opteron-sse3 athlon64 athlon64-sse3 athlon-fx amdfam10 barcelona bdver1 bdver2 bdver3 bdver4 znver1 btver1 btver2 native; did you mean ‘native’? Ready for trunk after tests? Thanks Martin gcc/ChangeLog: 2018-02-20 Martin Liska PR driver/83193 * config/i386/i386.c (ix86_option_override_internal): Add "native" as a possible value. --- gcc/config/i386/i386.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index d54e7301e84..361d4df2663 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -4193,6 +4193,9 @@ ix86_option_override_internal (bool main_args_p, || ((processor_alias_table[i].flags & PTA_64BIT) != 0))) candidates.safe_push (processor_alias_table[i].name); + /* Add also "native" as possible value. */ + candidates.safe_push ("native"); + char *s; const char *hint = candidates_list_and_hint (opts->x_ix86_arch_string, s, candidates);