From patchwork Fri Dec 18 09:34:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Krebbel X-Patchwork-Id: 558793 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 1A9591401AF for ; Fri, 18 Dec 2015 20:34:41 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=ivNBDyJK; dkim-atps=neutral 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:subject:message-id:mime-version:content-type; q=dns; s= default; b=jXXLHoXBudh0hJVADqSIF6xvSROtegy8kfIWTjuU+fsRdiQS8ykH4 FQcD178U/vmubK4M+/HLP8gdfCF0RcO64Ov/0r91WuAzrLDGDqpptVTiyGvGbGPV i9Kzv+Fs1lKWpUbpmqcc6XQnd7xitlIIFXKmZ8OJahjE29G0CUsPro= 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:subject:message-id:mime-version:content-type; s= default; bh=79akTf4/x+cDFEnYVB73HGvEgtQ=; b=ivNBDyJKLsVr5EW7jqZ2 Rwy9vRV1egnqkBYplSAlCbWiOYhv2ViKaxFWOKQ9/ABOK2Gcyo1OijaZTdqtAxjb xI8NsLpPgzIZBUq7YOr8qgbzVcM8CVZqf/HyeIEBi/A78JKApspSuQ7gFtvjUv7n uYpXl54sICAboLyCtrXcHig= Received: (qmail 39755 invoked by alias); 18 Dec 2015 09:34:34 -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 39740 invoked by uid 89); 18 Dec 2015 09:34:32 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.0 required=5.0 tests=AWL, BAYES_05, KAM_LAZY_DOMAIN_SECURITY, LONG_TERM_PRICE, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=cmdline, m31, representing, s390.c X-HELO: e06smtp07.uk.ibm.com Received: from e06smtp07.uk.ibm.com (HELO e06smtp07.uk.ibm.com) (195.75.94.103) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Fri, 18 Dec 2015 09:34:31 +0000 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Fri, 18 Dec 2015 09:34:28 -0000 Received: from d06dlp02.portsmouth.uk.ibm.com (9.149.20.14) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Fri, 18 Dec 2015 09:34:25 -0000 X-IBM-Helo: d06dlp02.portsmouth.uk.ibm.com X-IBM-MailFrom: krebbel@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by d06dlp02.portsmouth.uk.ibm.com (Postfix) with ESMTP id 8363E2190046 for ; Fri, 18 Dec 2015 09:34:16 +0000 (GMT) Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id tBI9YOnH34144368 for ; Fri, 18 Dec 2015 09:34:25 GMT Received: from d06av11.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id tBI9YOxp031546 for ; Fri, 18 Dec 2015 02:34:24 -0700 Received: from bart (icon-9-167-237-18.megacenter.de.ibm.com [9.167.237.18]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with SMTP id tBI9YNfe031461 for ; Fri, 18 Dec 2015 02:34:23 -0700 Received: by bart (sSMTP sendmail emulation); Fri, 18 Dec 2015 10:34:23 +0100 Date: Fri, 18 Dec 2015 10:34:23 +0100 From: Andreas Krebbel To: gcc-patches@gcc.gnu.org Subject: [Committed] S/390: Deprecate g5 and g6 CPU levels. Message-ID: <20151218093423.GA3648@maggie> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15121809-0029-0000-0000-000005390EDB X-IsSubscribed: yes Hi, I've committed the attached patch which emits warnings whenever g5 or g6 are being used explicitely as -march/-mtune parameters. These machines can only be seen in museums nowadays and have no practical use anymore. They do not support the z/Architecture mode required for 64 bit. The Linux kernel does not support them either. In the GCC back-end the code to support these old CPU levels is particularly annoying since they do not provide long relative addressing (larl and brasl). Hence much of the literal pool special handling exists only because of supporting these CPUs. I would like to get rid of this someday in the future. Note: This does not remove support for -mesa yet. One can still compile code targetting kernels running in ESA mode. Since this isn't supported by the kernel anymore the long term target of course is to get rid of this as well. But unfortunately we still have that problem with the inline asms which needs to be addressed first ... Committed to mainline. Bye, -Andreas- gcc/ChangeLog: 2015-12-18 Andreas Krebbel * config/s390/driver-native.c (s390_host_detect_local_cpu): Pick z900 -march -mtune even on g5 and g6 machines. * config/s390/s390.c (s390_option_override_internal): New argument to distingiush between options and target attributes. Emit deprecation warning for g5 and g6 arch/tune options. (s390_option_override): Set new s390_option_override_internal argument to true. (s390_valid_target_attribute_tree): Set new s390_option_override_internal argument to false. * config/s390/s390.h: Default to z900 in the driver. * doc/invoke.texi: Document the deprecation of g5 and g6. gcc/testsuite/ChangeLog: 2015-12-18 Andreas Krebbel * gcc.target/s390/hotpatch-8.c: Add -Wno-deprecated to options. * gcc.target/s390/hotpatch-9.c: Likewise. diff --git a/gcc/config/s390/driver-native.c b/gcc/config/s390/driver-native.c index 5f7fe0a..08ec85e 100644 --- a/gcc/config/s390/driver-native.c +++ b/gcc/config/s390/driver-native.c @@ -84,9 +84,8 @@ s390_host_detect_local_cpu (int argc, const char **argv) machine_id = strtol (p, NULL, 16); switch (machine_id) { + /* g5 and g6 default to z900 */ case 0x9672: - cpu = "g5"; - break; case 0x2064: case 0x2066: cpu = "z900"; diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c index bc6f05b..2a42818 100644 --- a/gcc/config/s390/s390.c +++ b/gcc/config/s390/s390.c @@ -13569,9 +13569,27 @@ s390_function_specific_restore (struct gcc_options *opts, } static void -s390_option_override_internal (struct gcc_options *opts, +s390_option_override_internal (bool main_args_p, + struct gcc_options *opts, const struct gcc_options *opts_set) { + const char *prefix; + const char *suffix; + + /* Set up prefix/suffix so the error messages refer to either the command + line argument, or the attribute(target). */ + if (main_args_p) + { + prefix = "-m"; + suffix = ""; + } + else + { + prefix = "option(\""; + suffix = "\")"; + } + + /* Architecture mode defaults according to ABI. */ if (!(opts_set->x_target_flags & MASK_ZARCH)) { @@ -13583,13 +13601,26 @@ s390_option_override_internal (struct gcc_options *opts, /* Set the march default in case it hasn't been specified on cmdline. */ if (!opts_set->x_s390_arch) - opts->x_s390_arch = TARGET_ZARCH_P (opts->x_target_flags) - ? PROCESSOR_2064_Z900 : PROCESSOR_9672_G5; + opts->x_s390_arch = PROCESSOR_2064_Z900; + else if (opts->x_s390_arch == PROCESSOR_9672_G5 + || opts->x_s390_arch == PROCESSOR_9672_G6) + warning (OPT_Wdeprecated, "%sarch=%s%s is deprecated and will be removed " + "in future releases; use at least %sarch=z900%s", + prefix, opts->x_s390_arch == PROCESSOR_9672_G5 ? "g5" : "g6", + suffix, prefix, suffix); + opts->x_s390_arch_flags = processor_flags_table[(int) opts->x_s390_arch]; /* Determine processor to tune for. */ if (!opts_set->x_s390_tune) opts->x_s390_tune = opts->x_s390_arch; + else if (opts->x_s390_tune == PROCESSOR_9672_G5 + || opts->x_s390_tune == PROCESSOR_9672_G6) + warning (OPT_Wdeprecated, "%stune=%s%s is deprecated and will be removed " + "in future releases; use at least %stune=z900%s", + prefix, opts->x_s390_tune == PROCESSOR_9672_G5 ? "g5" : "g6", + suffix, prefix, suffix); + opts->x_s390_tune_flags = processor_flags_table[opts->x_s390_tune]; /* Sanity checks. */ @@ -13800,7 +13831,7 @@ s390_option_override (void) /* Set up function hooks. */ init_machine_status = s390_init_machine_status; - s390_option_override_internal (&global_options, &global_options_set); + s390_option_override_internal (true, &global_options, &global_options_set); /* Save the initial options in case the user does function specific options. */ @@ -14102,7 +14133,7 @@ s390_valid_target_attribute_tree (tree args, dest[i] |= src[i]; /* Do any overrides, such as arch=xxx, or tune=xxx support. */ - s390_option_override_internal (opts, &new_opts_set); + s390_option_override_internal (false, opts, &new_opts_set); /* Save the current options unless we are validating options for #pragma. */ t = build_target_option_node (opts); diff --git a/gcc/config/s390/s390.h b/gcc/config/s390/s390.h index 52ed7a4..603e638 100644 --- a/gcc/config/s390/s390.h +++ b/gcc/config/s390/s390.h @@ -214,7 +214,7 @@ extern const char *s390_host_detect_local_cpu (int argc, const char **argv); MARCH_MTUNE_NATIVE_SPECS, \ "%{!m31:%{!m64:-m" S390_TARGET_BITS_STRING "}}", \ "%{!mesa:%{!mzarch:%{m31:-mesa}%{m64:-mzarch}}}", \ - "%{!march=*:%{mesa:-march=g5}%{mzarch:-march=z900}}" + "%{!march=*:-march=z900}" /* Constants needed to control the TEST DATA CLASS (TDC) instruction. */ #define S390_TDC_POSITIVE_ZERO (1 << 11) diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 9b3e2fe..346e40b 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -20893,14 +20893,12 @@ The default is to not print debug information. @item -march=@var{cpu-type} @opindex march -Generate code that runs on @var{cpu-type}, which is the name of a system -representing a certain processor type. Possible values for -@var{cpu-type} are @samp{g5}, @samp{g6}, @samp{z900}, @samp{z990}, -@samp{z9-109}, @samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12}, -and @samp{z13}. -When generating code using the instructions available on z/Architecture, -the default is @option{-march=z900}. Otherwise, the default is -@option{-march=g5}. +Generate code that runs on @var{cpu-type}, which is the name of a +system representing a certain processor type. Possible values for +@var{cpu-type} are @samp{z900}, @samp{z990}, @samp{z9-109}, +@samp{z9-ec}, @samp{z10}, @samp{z196}, @samp{zEC12}, and @samp{z13}. +The default is @option{-march=z900}. @samp{g5} and @samp{g6} are +deprecated and will be removed with future releases. @item -mtune=@var{cpu-type} @opindex mtune diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-8.c b/gcc/testsuite/gcc.target/s390/hotpatch-8.c index 1ea3160..c5b71a5 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-8.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-8.c @@ -1,7 +1,7 @@ /* Functional tests for the function hotpatching feature. */ /* { dg-do compile { target { ! lp64 } } } */ -/* { dg-options "-mesa -march=g5 -mhotpatch=0,3" } */ +/* { dg-options "-mesa -march=g5 -Wno-deprecated -mhotpatch=0,3" } */ #include diff --git a/gcc/testsuite/gcc.target/s390/hotpatch-9.c b/gcc/testsuite/gcc.target/s390/hotpatch-9.c index e30f276..9ccc8fd 100644 --- a/gcc/testsuite/gcc.target/s390/hotpatch-9.c +++ b/gcc/testsuite/gcc.target/s390/hotpatch-9.c @@ -1,7 +1,7 @@ /* Functional tests for the function hotpatching feature. */ /* { dg-do compile { target { ! lp64 } } } */ -/* { dg-options "-mesa -march=g5 -mhotpatch=0,4" } */ +/* { dg-options "-mesa -march=g5 -Wno-deprecated -mhotpatch=0,4" } */ #include