From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 978 invoked by alias); 30 Aug 2011 15:52:30 -0000 Received: (qmail 954 invoked by uid 22791); 30 Aug 2011 15:52:28 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=AWL,BAYES_00,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; Tue, 30 Aug 2011 15:52:14 +0000 Received: (qmail 31254 invoked from network); 30 Aug 2011 15:52:13 -0000 Received: from unknown (HELO digraph.polyomino.org.uk) (joseph@127.0.0.2) by mail.codesourcery.com with ESMTPA; 30 Aug 2011 15:52:13 -0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.74) (envelope-from ) id 1QyQbk-0007Yx-8V; Tue, 30 Aug 2011 15:52:12 +0000 Date: Tue, 30 Aug 2011 16:50:00 -0000 From: "Joseph S. Myers" To: Gary Funck cc: Gcc Patches Subject: Re: options generation and language count In-Reply-To: <20110829234640.GB26527@intrepid.com> Message-ID: References: <20110829234640.GB26527@intrepid.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII 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 X-SW-Source: 2011-08/txt/msg02473.txt.bz2 On Mon, 29 Aug 2011, Gary Funck wrote: > 1) The sanity check should probably read: > gcc_assert ((1U << cl_lang_count) <= CL_MIN_OPTION_CLASS); > In other words, it is off-by-one. Please send a patch. > 2) The fixed shift counts starting at CL_PARAMS probably need to be > adjusted upwards to allow for more languages. Plese send a patch. I moved lots of flags to bit-fields so there is now plenty of room to move flags up. > A third problem, is that this sort of error would be better detected > at build time rather than waiting to run a DejaGNU test to find it. Please send a patch. Making optc-gen.awk or opth-gen.awk output #if conditions surrounding a #error would be the usual approach. > Also, the use of fixed masks is problematic. Perhaps the AWK script > could be changed to also generate values for CL_PARAMS, etc., ensuring > that will not conflict with the language mask values? That sounds riskier (and does everywhere using opts.h actually need the generated options.h as well?), although in principle it ought to be possible to assign this automatically (and actually only CL_DRIVER, CL_TARGET and CL_COMMON should really need bits assigned, though avoiding the others would require a --help rework). -- Joseph S. Myers joseph@codesourcery.com