From patchwork Fri Oct 5 02:49:25 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Gorbachev X-Patchwork-Id: 189410 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 393C22C0327 for ; Fri, 5 Oct 2012 12:49:42 +1000 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1350010183; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:Date:Message-ID:Subject:From:To: Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=qbwp9Vg UnUu7adnjXSCCQlpbpLo=; b=O5iVMRLNlI9xSgXWKf2UodI0B2CMqa6r8uL2rFi aG554zEi5GYDuUwKmwho+3Ddzkx/GF1F8LI4L0+9iYJ8iWJO7tWgodePWpG+oSJf npFWRc7rF3BHfUPhlcVXaWw5XjhnuWPBN6/UjUjXeCSw9M79rr/wDXOipOvRL2vo 2hes= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:MIME-Version:Received:Received:Date:Message-ID:Subject:From:To:Content-Type:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=nSpo8WlAmJx+o5feGBLzhGOINFfk1hU7i1JK77jq1Nx7CUslP5pfg+pcFznWvZ eoyBwRBN9+YdLFbSgYTuEOEa11RktbkaMtAveL9ZYB561MQfLKVmgoQgjLZ055Zn eNg7iBMNleX+s2toXfboB2Cj+xnPXBNJcHsbg/zwt++a0=; Received: (qmail 22350 invoked by alias); 5 Oct 2012 02:49:35 -0000 Received: (qmail 22336 invoked by uid 22791); 5 Oct 2012 02:49:31 -0000 X-SWARE-Spam-Status: No, hits=-4.0 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-vc0-f175.google.com (HELO mail-vc0-f175.google.com) (209.85.220.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 05 Oct 2012 02:49:26 +0000 Received: by mail-vc0-f175.google.com with SMTP id p1so1628427vcq.20 for ; Thu, 04 Oct 2012 19:49:25 -0700 (PDT) MIME-Version: 1.0 Received: by 10.58.249.134 with SMTP id yu6mr3328065vec.27.1349405365607; Thu, 04 Oct 2012 19:49:25 -0700 (PDT) Received: by 10.58.15.4 with HTTP; Thu, 4 Oct 2012 19:49:25 -0700 (PDT) Date: Fri, 5 Oct 2012 06:49:25 +0400 Message-ID: Subject: [PATCH] PR 54789: Fix driver error when GCC_COMPARE_DEBUG is defined From: Dmitry Gorbachev To: gcc-patches 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 This patch simplifies process_command a bit by using save_switch and sets the "known" switch field to "true". gcc/ChangeLog: 2012-10-05 Dmitry Gorbachev PR driver/54789 * gcc.c (process_command): Use save_switch for synthesized -fcompare-debug=* option; mark the switch as known. --- gcc/gcc.c +++ gcc/gcc.c @@ -3961,18 +3961,12 @@ process_command (unsigned int decoded_options_count, if (n_infiles == last_language_n_infiles && spec_lang != 0) warning (0, "%<-x %s%> after last input file has no effect", spec_lang); + /* Synthesize -fcompare-debug flag from the GCC_COMPARE_DEBUG + environment variable. */ if (compare_debug == 2 || compare_debug == 3) { - alloc_switch (); - switches[n_switches].part1 = concat ("fcompare-debug=", - compare_debug_opt, - NULL); - switches[n_switches].args = 0; - switches[n_switches].live_cond = 0; - switches[n_switches].validated = false; - switches[n_switches].known = false; - switches[n_switches].ordering = 0; - n_switches++; + const char *opt = concat ("-fcompare-debug=", compare_debug_opt, NULL); + save_switch (opt, 0, NULL, false, true); compare_debug = 1; }