From patchwork Sat Apr 28 10:04:13 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Kravets X-Patchwork-Id: 155642 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 BB53AB6FEA for ; Sat, 28 Apr 2012 20:04:37 +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=1336212279; h=Comment: DomainKey-Signature:Received:Received:Received:MIME-version: Received:Received:Date:From:Subject:To:Message-id:Content-type: Content-disposition:User-Agent:Mailing-List:Precedence:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:Sender: Delivered-To; bh=1jvGI7JYNTT/1mgR8RDwdgb2qTA=; b=I0vZnrfFZWnWK90 YOCnIx0oE31EqFbdl0s5XucF4tnLC/3EdyCtRQLcIt2p3FwiemG08EL6KSkesHv9 T75UTGduysTTyV2C0A/eApbq0On9y1A9qcHWnWxq3+tGbViJO/pLNDc6LOmexYsc LJsPfs8uYHskPxop55L+0KMrAW48= 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:MIME-version:Received:Received:Date:From:Subject:To:Message-id:Content-type:Content-disposition:User-Agent:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=X4EKXVS5vSx9Xenjh9cl9BYnuoS4Uh9GAWSOQcQzMraRIJtypECvJ90Kp6VBIO EF20dKekzlmjrNzlxYhfKNuxlzOpZpJ0cEyQJHOVzzb96MHAiK/5JDC6tm6N7mp5 GD2pKcaddJWK5r4k+uaDc09aYCkqS+87GYJEvD0s7PzyM=; Received: (qmail 17296 invoked by alias); 28 Apr 2012 10:04:34 -0000 Received: (qmail 17283 invoked by uid 22791); 28 Apr 2012 10:04:33 -0000 X-SWARE-Spam-Status: No, hits=-9.4 required=5.0 tests=BAYES_00, KHOP_PGP_SIGNED, KHOP_RCVD_UNTRUST, RCVD_IN_DNSWL_HI, SPF_HELO_PASS, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mailout3.w1.samsung.com (HELO mailout3.w1.samsung.com) (210.118.77.13) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 28 Apr 2012 10:04:19 +0000 MIME-version: 1.0 Received: from euspt2 ([210.118.77.13]) by mailout3.w1.samsung.com (Sun Java(tm) System Messaging Server 6.3-8.04 (built Jul 29 2009; 32bit)) with ESMTP id <0M3600752PA8B500@mailout3.w1.samsung.com> for gcc-patches@gcc.gnu.org; Sat, 28 Apr 2012 11:03:44 +0100 (BST) Received: from localhost ([106.109.9.128]) by spt2.w1.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0M3600KS3PB11T@spt2.w1.samsung.com> for gcc-patches@gcc.gnu.org; Sat, 28 Apr 2012 11:04:14 +0100 (BST) Date: Sat, 28 Apr 2012 14:04:13 +0400 From: Alexey Kravets Subject: [PATCH] pr51020 Fix invalid options validation for ARM target To: gcc-patches@gcc.gnu.org Message-id: <20120428100413.GA25747@kayrick-tools> Content-type: multipart/signed; boundary=xXmbgvnjoT4axfJE; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) 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 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. 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.target/arm/pr51020.c b/gcc/testsuite/gcc.target/arm/pr51020.c new file mode 100644 index 0000000..ac77dc1 --- /dev/null +++ b/gcc/testsuite/gcc.target/arm/pr51020.c @@ -0,0 +1,5 @@ +/* PR 51020 */ +/* { dg-do compile { target arm*-*-* } } */ +/* { dg-options "---" { target arm*-*-* } } */ +int main() {return 0;} +/* { dg-error "unrecognized option '---'" "" { target *-*-* } 0 } */ -- 1.7.5.4