From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 116729 invoked by alias); 22 Jul 2019 18:54:25 -0000 Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org Received: (qmail 116459 invoked by uid 89); 22 Jul 2019 18:54:23 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: mail-vs1-f49.google.com Received: from mail-vs1-f49.google.com (HELO mail-vs1-f49.google.com) (209.85.217.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 22 Jul 2019 18:54:21 +0000 Received: by mail-vs1-f49.google.com with SMTP id u124so26990925vsu.2 for ; Mon, 22 Jul 2019 11:54:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=jJo5qxh4DyMVNW/vsmsasg5fmF8JzYNQZb1MxPfDRsg=; b=Y3cBL7PW5i9uxYY1nEF45seEywIZVA29kCkHSZ+6QWy+BfZafFUn8qS5jdhrFYKz6A jgxjRKzzIyPCvfWsHCU+Vyf9JcW51FXKiPl0CqwgWytqX01L5P3ZGOdcKVnWkS3WtKdy xCpy+ko24VJrp/keAia5FKoTaJKOOhzO1BX7VtT3G0qpGugGZok+kWfBBUXyoFf9rjvi s5R+mpPfgZ4IAJKSznpwumeNTvnlNf1vzcN2P4HjVNqPNmvje1dVrXe+5Iyq+Y9AGXFv Y6jDa4v2We4YTyX68FoIQycrc+TGc38gn6+le619K+X3aywAT1f+hN9+R3Z4H1Ox09Gi sKCA== MIME-Version: 1.0 References: In-Reply-To: From: Jim Wilson Date: Mon, 22 Jul 2019 18:54:00 -0000 Message-ID: Subject: Re: gcc/config/arch/arch.opt: Option mask gen problem To: Maxim Blinov Cc: GCC Development Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2019-07/txt/msg00155.txt.bz2 On Mon, Jul 22, 2019 at 4:05 AM Maxim Blinov wrote: > Is it possible, in the arch.opt file, to have GCC generate a bitmask > relative to a user-defined variable without an associated name? To > illustrate my problem, consider the following option file snippet: > ... > But, I don't want the user to be able to pass "-mbmi-zbb" or > "-mno-bmi-zbb" on the command line: If you don't want an option, why are you making changes to the riscv.opt file? This is specifically for supporting command line options. Adding a variable here does mean that it will automatically be saved and restored, and I can see the advantage of doing that, even if it is only indirectly tied to options. You could add a variable here, and then manually define the bitmasks yourself in riscv-opt.h or riscv.h. Or you could just add the variable to the machine_function struct in riscv.c, which will also automatically save and restore the variable. Jim