From patchwork Tue Dec 24 20:38:09 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 305057 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 E4E8A2C00A5 for ; Wed, 25 Dec 2013 07:38:19 +1100 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; q=dns; s=default; b=RUiFHcjH6a8bgaDnzgv9emJE0BDyo JaP3gHZdMxixtBhkeAUc5soJAoRooe10Oo/VrDvKKGm9bmNHKgwqHT89o+rND/Od PE12cUng1XnqwZmeOYi164KaoPzaR0eO9oGHt5RhZS4vhQ3IlNx9SDw+XQPYeRpM ZRwaPnhsdx7djc= 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:date :from:to:cc:subject:message-id:reply-to:mime-version :content-type; s=default; bh=XalRSbBSAIacvFGv/HjWOaLEm2Y=; b=x8f lgsz01Zc5+CUsrzhy5/mvDrSnTlxNjEQS156vaP6MKEIZ8uSgqP4DP6SjubWYYCW HsWNoO1MJtnrK8DwdC+pNTwG7fpdGRxSuOOgfxrr4NL9b3aFuqFUaBj8NLwo2wOq clFMill6MOJC88mN9VpaoKPDqAzOAXpxXLkVwDWA= Received: (qmail 10583 invoked by alias); 24 Dec 2013 20:38:13 -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 10572 invoked by uid 89); 24 Dec 2013 20:38:12 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=AWL, BAYES_00, NO_DNS_FOR_FROM, RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mga09.intel.com Received: from mga09.intel.com (HELO mga09.intel.com) (134.134.136.24) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Dec 2013 20:38:11 +0000 Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga102.jf.intel.com with ESMTP; 24 Dec 2013 12:34:18 -0800 X-ExtLoop1: 1 Received: from gnu-6.sc.intel.com ([10.3.194.135]) by orsmga002.jf.intel.com with ESMTP; 24 Dec 2013 12:38:10 -0800 Received: by gnu-6.sc.intel.com (Postfix, from userid 1000) id BADA8810D4; Tue, 24 Dec 2013 12:38:09 -0800 (PST) Date: Tue, 24 Dec 2013 12:38:09 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Cc: hubicka@ucw.cz Subject: PATCH: PR target/59588: Don't check/change generic/i686 tuning Message-ID: <20131224203809.GA6048@intel.com> Reply-To: "H.J. Lu" MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Hi Honza, We have combined generic32 and generic64 into generic. There is no need to check "generic" anymore. Also we shouldn't change -mtune=i686 into -mtune=generic. OK to install? Thanks. H.J. --- gcc/ 2013-12-24 H.J. Lu PR target/59588 * config/i386/i386.c (ix86_option_override_internal): Don't check generic tuning. Don't change i686 tuning. gcc/testsuite/ 2013-12-24 H.J. Lu PR target/59588 * gcc.target/i386/pr59588-1.c: New file. * gcc.target/i386/pr59588-2.c: Likewise. diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c index f5d9ce5..b95a620 100644 --- a/gcc/config/i386/i386.c +++ b/gcc/config/i386/i386.c @@ -3332,23 +3332,13 @@ ix86_option_override_internal (bool main_args_p, /* Need to check -mtune=generic first. */ if (opts->x_ix86_tune_string) { - if (!strcmp (opts->x_ix86_tune_string, "generic") - || !strcmp (opts->x_ix86_tune_string, "i686") - /* As special support for cross compilers we read -mtune=native + /* As special support for cross compilers we read -mtune=native as -mtune=generic. With native compilers we won't see the -mtune=native, as it was changed by the driver. */ - || !strcmp (opts->x_ix86_tune_string, "native")) + if (!strcmp (opts->x_ix86_tune_string, "native")) { opts->x_ix86_tune_string = "generic"; } - /* If this call is for setting the option attribute, allow the - generic that was previously set. */ - else if (!main_args_p - && !strcmp (opts->x_ix86_tune_string, "generic")) - ; - else if (!strncmp (opts->x_ix86_tune_string, "generic", 7)) - error ("bad value (%s) for %stune=%s %s", - opts->x_ix86_tune_string, prefix, suffix, sw); else if (!strcmp (opts->x_ix86_tune_string, "x86-64")) warning (OPT_Wdeprecated, "%stune=x86-64%s is deprecated; use " "%stune=k8%s or %stune=generic%s instead as appropriate", @@ -3366,9 +3356,7 @@ ix86_option_override_internal (bool main_args_p, /* opts->x_ix86_tune_string is set to opts->x_ix86_arch_string or defaulted. We need to use a sensible tune option. */ - if (!strcmp (opts->x_ix86_tune_string, "generic") - || !strcmp (opts->x_ix86_tune_string, "x86-64") - || !strcmp (opts->x_ix86_tune_string, "i686")) + if (!strcmp (opts->x_ix86_tune_string, "x86-64")) { opts->x_ix86_tune_string = "generic"; } @@ -3648,7 +3636,7 @@ ix86_option_override_internal (bool main_args_p, else if (!strcmp (opts->x_ix86_arch_string, "intel")) error ("intel CPU can be used only for %stune=%s %s", prefix, suffix, sw); - else if (!strncmp (opts->x_ix86_arch_string, "generic", 7) || i == pta_size) + else if (i == pta_size) error ("bad value (%s) for %sarch=%s %s", opts->x_ix86_arch_string, prefix, suffix, sw); diff --git a/gcc/testsuite/gcc.target/i386/pr59588-1.c b/gcc/testsuite/gcc.target/i386/pr59588-1.c new file mode 100644 index 0000000..391f2aa --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr59588-1.c @@ -0,0 +1,7 @@ +/* { dg-do preprocess } */ +/* { dg-require-effective-target ia32 } */ +/* { dg-options "-march=i686" } */ + +#ifndef __tune_i686__ +#error "__tune_i686__ should defined for this test" +#endif diff --git a/gcc/testsuite/gcc.target/i386/pr59588-2.c b/gcc/testsuite/gcc.target/i386/pr59588-2.c new file mode 100644 index 0000000..bb5f12a --- /dev/null +++ b/gcc/testsuite/gcc.target/i386/pr59588-2.c @@ -0,0 +1,7 @@ +/* { dg-do preprocess } */ +/* { dg-require-effective-target ia32 } */ +/* { dg-options "-mtune=i686" } */ + +#ifndef __tune_i686__ +#error "__tune_i686__ should defined for this test" +#endif