From patchwork Thu May 5 19:34:19 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joseph Myers X-Patchwork-Id: 94302 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]) by ozlabs.org (Postfix) with SMTP id 6ECC0B6EF1 for ; Fri, 6 May 2011 05:34:41 +1000 (EST) Received: (qmail 11011 invoked by alias); 5 May 2011 19:34:40 -0000 Received: (qmail 10944 invoked by uid 22791); 5 May 2011 19:34:39 -0000 X-SWARE-Spam-Status: No, hits=-1.7 required=5.0 tests=AWL, BAYES_00, TW_MF, TW_MX, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 May 2011 19:34:25 +0000 Received: (qmail 27832 invoked from network); 5 May 2011 19:34:24 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 5 May 2011 19:34:24 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.72) (envelope-from ) id 1QI4JX-0005Y0-IS; Thu, 05 May 2011 19:34:19 +0000 Date: Thu, 5 May 2011 19:34:19 +0000 (UTC) From: "Joseph S. Myers" To: Michael Eager cc: David Edelsohn , GCC Patches , amodra@gmail.com Subject: Re: rs6000_handle_option global state avoidance, part 1 In-Reply-To: <4DC2D988.9010300@eagercon.com> Message-ID: References: <4DC2D988.9010300@eagercon.com> MIME-Version: 1.0 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 On Thu, 5 May 2011, Michael Eager wrote: > David Edelsohn wrote: > > On Wed, May 4, 2011 at 7:54 AM, Joseph S. Myers > > wrote: > > > > > Two options, -mcmodel= and -mfpu=, had cases that fell through to the > > > next case without comments to indicate if this was intended. I added > > > comments to make the semantics explicit. Given the documentation, it > > > may well be intentional for -mcmodel= but is more doubtful for -mfpu=. > > > > I doubt that either of the fall through cases was intended. > > > > Alan, is mcmodel suppose to set m64? > > > > Michael, is mfpu suppose to set mrecip? > > No. There was a break statement at the end of case OPT_mfpu which > disappeared when OPT_mrecip was added. Thanks. I'll apply this patch which removes the fall through, and adds explicit Var and Init to the mfpu= entry in rs6000.opt to avoid problems (when building as C++, as shown by a regression tester) with 0-initialization of the field that gets automatically generated by the .opt machinery for any Target option not using Var. 2011-05-05 Joseph Myers * config/rs6000/rs6000.c (rs6000_handle_option): Don't fall through from -mfpu= handling. * config/rs6000/rs6000.opt (mfpu=): Use Var and Init. Index: gcc/config/rs6000/rs6000.opt =================================================================== --- gcc/config/rs6000/rs6000.opt (revision 173434) +++ gcc/config/rs6000/rs6000.opt (working copy) @@ -492,7 +492,7 @@ Target RejectNegative Var(rs6000_simple_ Floating point unit does not support divide & sqrt mfpu= -Target RejectNegative Joined Enum(fpu_type_t) +Target RejectNegative Joined Enum(fpu_type_t) Var(rs6000_fpu_type) Init(FPU_NONE) -mfpu= Specify FP (sp, dp, sp-lite, dp-lite) (implies -mxilinx-fpu) Enum Index: gcc/config/rs6000/rs6000.c =================================================================== --- gcc/config/rs6000/rs6000.c (revision 173434) +++ gcc/config/rs6000/rs6000.c (working copy) @@ -4480,7 +4480,7 @@ rs6000_handle_option (struct gcc_options opts_set->x_target_flags |= MASK_SOFT_FLOAT; opts->x_rs6000_single_float = opts->x_rs6000_double_float = 0; } - /* Fall through. */ + break; case OPT_mrecip: opts->x_rs6000_recip_name = (value) ? "default" : "none";