From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 35221 invoked by alias); 14 Sep 2015 19:44:29 -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 35206 invoked by uid 89); 14 Sep 2015 19:44:28 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.2 required=5.0 tests=AWL,BAYES_50,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-wi0-f169.google.com Received: from mail-wi0-f169.google.com (HELO mail-wi0-f169.google.com) (209.85.212.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 14 Sep 2015 19:44:27 +0000 Received: by wicfx3 with SMTP id fx3so321990wic.1 for ; Mon, 14 Sep 2015 12:44:25 -0700 (PDT) X-Received: by 10.194.174.201 with SMTP id bu9mr1555617wjc.73.1442259864977; Mon, 14 Sep 2015 12:44:24 -0700 (PDT) Received: from [10.46.16.81] (089144213081.atnat0022.highway.a1.net. [89.144.213.81]) by smtp.gmail.com with ESMTPSA id x7sm16011942wia.5.2015.09.14.12.44.23 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Sep 2015 12:44:24 -0700 (PDT) User-Agent: K-9 Mail for Android In-Reply-To: <55F6D9FF.4030600@st.com> References: <55F6D9FF.4030600@st.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Subject: Re: [PATCH 4/4] [ARM] Add attribute/pragma target fpu= From: Bernhard Reutner-Fischer Date: Mon, 14 Sep 2015 19:50:00 -0000 To: Christian Bruel ,kyrylo.tkachov@arm.com,Ramana.Radhakrishnan@arm.com CC: gcc-patches@gcc.gnu.org Message-ID: <7D8D22F4-ECEA-4BB6-A72E-2136C84EE981@gmail.com> X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00977.txt.bz2 On September 14, 2015 4:30:23 PM GMT+02:00, Christian Bruel wrote: >Finally, the final part of the patch set does the attribute target >parsing and checking, redefines the preprocessor macros and implements >the inlining rules. > >testcases and documentation included. @@ -29501,6 +29532,8 @@ static bool arm_valid_target_attribute_rec (tree args, struct gcc_options *opts) { + int ret=true; + if (TREE_CODE (args) == TREE_LIST) { bool ret = true; Doesn't the hunk above trigger a shadow warning? Furthermore there are missing spaces before and after the '='. And finally (no diff -p so I can only guess) why the int if the function returns a bool? Thanks, @@ -29518,30 +29551,35 @@ } char *argstr = ASTRDUP (TREE_STRING_POINTER (args)); - while (argstr && *argstr != '\0') + char *q; + + while ((q = strtok (argstr, ",")) != NULL) { - while (ISSPACE (*argstr)) - argstr++; + while (ISSPACE (*q)) ++q; - if (!strcmp (argstr, "thumb")) - { + argstr = NULL; + if (!strncmp (q, "thumb", 5)) opts->x_target_flags |= MASK_THUMB; - arm_option_check_internal (opts); - return true; - } - if (!strcmp (argstr, "arm")) - { + else if (!strncmp (q, "arm", 3)) opts->x_target_flags &= ~MASK_THUMB; - arm_option_check_internal (opts); - return true; + + else if (!strncmp (q, "fpu=", 4)) + { + if (! opt_enum_arg_to_value (OPT_mfpu_, q+4, + &opts->x_arm_fpu_index, CL_TARGET)) + { + error ("invalid fpu for attribute(target(\"%s\"))", q); + return false; + } } + else + warning (0, "attribute(target(\"%s\")) is unknown", argstr); - warning (0, "attribute(target(\"%s\")) is unknown", argstr); - return false; + arm_option_check_internal (opts); } - return false; + return ret; } > >thanks > >Christian