From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 83178 invoked by alias); 31 Oct 2015 17:58:42 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 83118 invoked by uid 89); 31 Oct 2015 17:58:41 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.4 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: e06smtp17.uk.ibm.com Received: from e06smtp17.uk.ibm.com (HELO e06smtp17.uk.ibm.com) (195.75.94.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 31 Oct 2015 17:58:40 +0000 Received: from localhost by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Sat, 31 Oct 2015 17:58:37 -0000 Received: from d06dlp01.portsmouth.uk.ibm.com (9.149.20.13) by e06smtp17.uk.ibm.com (192.168.101.147) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Sat, 31 Oct 2015 17:58:34 -0000 X-IBM-Helo: d06dlp01.portsmouth.uk.ibm.com X-IBM-MailFrom: vogt@linux.vnet.ibm.com X-IBM-RcptTo: gcc-patches@gcc.gnu.org Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by d06dlp01.portsmouth.uk.ibm.com (Postfix) with ESMTP id A7CDB17D8042 for ; Sat, 31 Oct 2015 17:58:47 +0000 (GMT) Received: from d06av05.portsmouth.uk.ibm.com (d06av05.portsmouth.uk.ibm.com [9.149.37.229]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id t9VHwX0x3801492 for ; Sat, 31 Oct 2015 17:58:34 GMT Received: from d06av05.portsmouth.uk.ibm.com (localhost [127.0.0.1]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id t9VHwX97008684 for ; Sat, 31 Oct 2015 11:58:33 -0600 Received: from bl3ahm9f.de.ibm.com (sig-9-83-39-32.evts.uk.ibm.com [9.83.39.32]) by d06av05.portsmouth.uk.ibm.com (8.14.4/8.14.4/NCO v10.0 AVin) with ESMTP id t9VHwXJk008679; Sat, 31 Oct 2015 11:58:33 -0600 Received: from dvogt by bl3ahm9f.de.ibm.com with local (Exim 4.76) (envelope-from ) id 1ZsaQC-0004Qu-Kt; Sat, 31 Oct 2015 18:58:32 +0100 Date: Sat, 31 Oct 2015 18:01:00 -0000 From: Dominik Vogt To: gcc-patches@gcc.gnu.org Cc: Andreas Krebbel Subject: Re: [PATCH 1/2] s/390: Implement "target" attribute. Message-ID: <20151031175832.GA16391@linux.vnet.ibm.com> Reply-To: vogt@linux.vnet.ibm.com Mail-Followup-To: gcc-patches@gcc.gnu.org, Andreas Krebbel References: <20150925135941.GA14892@linux.vnet.ibm.com> <20150925140123.GB14892@linux.vnet.ibm.com> <20151016123031.GA7320@linux.vnet.ibm.com> <20151026101022.GA3159@linux.vnet.ibm.com> <56337A23.2070607@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56337A23.2070607@linux.vnet.ibm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15103117-0029-0000-0000-000008E7FE78 X-SW-Source: 2015-10/txt/msg03494.txt.bz2 To improve readability, I'll split my answers (see below) into several separate messages. > > index 43459c8..4cf0df7 100644 > > --- a/gcc/common/config/s390/s390-common.c > > +++ b/gcc/common/config/s390/s390-common.c > > @@ -79,41 +79,27 @@ s390_option_init_struct (struct gcc_options *opts) > > > > /* Implement TARGET_HANDLE_OPTION. */ > > > > -static bool > > -s390_handle_option (struct gcc_options *opts, > > +bool > > +s390_handle_option (struct gcc_options *opts ATTRIBUTE_UNUSED, > > struct gcc_options *opts_set ATTRIBUTE_UNUSED, > > const struct cl_decoded_option *decoded, > > location_t loc) > > { > > size_t code = decoded->opt_index; > > - const char *arg = decoded->arg; > > int value = decoded->value; > > > > switch (code) > > { > > - case OPT_march_: > > - opts->x_s390_arch_flags = processor_flags_table[value]; > > - opts->x_s390_arch_string = arg; > > - return true; > > - > > case OPT_mstack_guard_: > > - if (exact_log2 (value) == -1) > > + if (value != 0 && exact_log2 (value) == -1) > > error_at (loc, "stack guard value must be an exact power of 2"); > > return true; > > > > case OPT_mstack_size_: > > - if (exact_log2 (value) == -1) > > + if (value != 0 && exact_log2 (value) == -1) > > error_at (loc, "stack size must be an exact power of 2"); > > return true; > > This probably is supposed to allow disabling of stack_guard and > stack-size options with 0 settings. Would removing the > `RejectNegative' in s390.opt be an option? The value 0 is meant to restore the default behaviour, i.e. switch off -mstack-guard= or resotre the default stack size for -mstack-size=. If we remove the RejectNegative from the options, they still require to be used as "-mno-stack-...=". The number is ignored of course, and we'd have to add two more cases to the function. In other words, more code for less usability. As an alternative, I can add something like this: mno-stack-guard Target RejectNegative Alias(mstack-guard=,0) Negative(mstack-guard=) This installs -mno-stack-guard as an alias for -mstack-guard=0 and provides the interface the user probably expects. The patch above is still necessary though. -- But what the heck is this "exact power of 2" limitation good for in the first place? Why is a stack size of 1, 2 or 36028797018963968 valid, but not 800? Shouldn't the stack size (and the size of the stack guard) just be multiples of the stack slot size? > > + memcpy (&options, &global_options, sizeof (options)); > options = global_options; Oops. > > + /* Cast to int to avoid Warning "comparison is always true". */ > What cast? Sorry, just forgot to remove the comment when changing the code last time. > - || new_opts_set.x_s390_warn_dynamicstack_p > - ) > + || new_opts_set.x_s390_warn_dynamicstack_p) Ok. > - > return t; Ok. > mtune= > -Target RejectNegative Joined Enum(processor_type) Var(s390_tune) Init(PROCESSOR_max) Save. > +Target RejectNegative Joined Enum(processor_type) Var(s390_tune) Init(PROCESSOR_max) Save > Schedule code for given CPU The full stop should be at the end of the help text, of course. Ciao Dominik ^_^ ^_^ -- Dominik Vogt IBM Germany