From patchwork Tue May 1 19:21:28 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kravets X-Patchwork-Id: 156187 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 4E16BB6FA5 for ; Wed, 2 May 2012 05:21:53 +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=1336504913; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To: User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:Sender:Delivered-To; bh=sF+9sVD IyxgUj2mic7gyJ0au0ig=; b=R/rj/00f7FgFgjg68byD7bZRpENCRhS5iHIc/0b URPV1gS9osYqjEfmBznHAuX6vTfRSB9C5Hk6kfG4zn02l0bs9qOsV/yerlINgZHo 4NfeMquP7/sS+Ht2Qa+aZ7w99TMxbiQ8sUrfyWxnOmNLHjjb8xRdu+z2u9VQsijT Qy9E= 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:Received:Received:Date:From:To:Cc:Subject:Message-ID:References:MIME-Version:Content-Type:Content-Disposition:In-Reply-To:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=iI0OXgYn4zP25JKzEzMoijFgZ9PigZe32VGW8VKdFEug7vjbxsSJBw2GWR7juw XJRhXyJMdbrPlqQwtHfBQpUgu4Qdv/ijHG9l09XINBvrSx77V/Fig5SHva6fAGAh 6P1dFjP+Iu3JAHakJT91iTRHFVK+ozqvgqyQVcSrhiTWc=; Received: (qmail 8978 invoked by alias); 1 May 2012 19:21:48 -0000 Received: (qmail 8967 invoked by uid 22791); 1 May 2012 19:21:47 -0000 X-SWARE-Spam-Status: No, hits=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_PGP_SIGNED, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-lpp01m010-f47.google.com (HELO mail-lpp01m010-f47.google.com) (209.85.215.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 01 May 2012 19:21:33 +0000 Received: by lagw12 with SMTP id w12so2934641lag.20 for ; Tue, 01 May 2012 12:21:31 -0700 (PDT) Received: by 10.112.84.202 with SMTP id b10mr12336003lbz.7.1335900091724; Tue, 01 May 2012 12:21:31 -0700 (PDT) Received: from localhost ([62.141.83.19]) by mx.google.com with ESMTPS id te8sm20869847lab.3.2012.05.01.12.21.29 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 01 May 2012 12:21:30 -0700 (PDT) Date: Tue, 1 May 2012 23:21:28 +0400 From: Alexey Kravets To: gcc-patches@gcc.gnu.org Cc: Alexey Kravets Subject: Re: [PATCH] pr51020 Fix invalid options validation for ARM target Message-ID: <20120501192128.GA3806@kayrick-lair> References: <20120428100413.GA25747@kayrick-tools> <4F9E9057.8010607@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <4F9E9057.8010607@arm.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes 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 Mon, Apr 30, 2012 at 02:15:03PM +0100, Richard Earnshaw wrote: > On 28/04/12 11:04, Alexey Kravets wrote: > > Hi guys, > > Please, take a look at this patch. It fixes the invalid star symbol > > processing in validate_switches function reported in GCC bugzilla: > > http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51020 > > > > With this patch invalid options are no longer accepted by the > > compiler (see new testcase for more details). > > It showed no regressions on GCC-4.6.3 on ARM. > > > > ChangeLog: > > * gcc/gcc.c(validate_switches): Reset starred flag. > > * gcc/testsuite/gcc.target/arm/pr51020.c: New test. > > > > Why have you created an arm-specific test for something that, at least > on initial examination, is a generic issue? Yes, that is my bad. I have updated the test to be generic and rerun testsuite on x86_64 machine (with no regressions). The updated patch is attached. > > R. > diff --git a/gcc/gcc.c b/gcc/gcc.c index 75f522e..e3c8609 100644 --- a/gcc/gcc.c +++ b/gcc/gcc.c @@ -7023,11 +7023,12 @@ validate_switches (const char *start) size_t len; int i; bool suffix = false; - bool starred = false; + bool starred; #define SKIP_WHITE() do { while (*p == ' ' || *p == '\t') p++; } while (0) next_member: + starred = false; SKIP_WHITE (); if (*p == '!') diff --git a/gcc/testsuite/gcc.dg/pr51020.c b/gcc/testsuite/gcc.dg/pr51020.c new file mode 100644 index 0000000..ac77dc1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr51020.c @@ -0,0 +1,5 @@ +/* PR 51020 */ +/* { dg-do compile } */ +/* { dg-options "---" } */ +int main() {return 0;} +/* { dg-error "unrecognized.*'---'" "" { target *-*-* } 0 } */ -- 1.7.5.4