From patchwork Sat Sep 28 08:44:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Endo X-Patchwork-Id: 1168813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-509754-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=t-online.de Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="tCYsLiEi"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46gMfd3PzHz9sN1 for ; Sat, 28 Sep 2019 18:44:38 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; q= dns; s=default; b=MDH7esZPv0hSYdcWdOTMgy0PUnoCL8l1qK6s+l56+osqZi 16tF3m8zoLCmzIwKySKhAy8Dv9cFWZYbfjQDfrpjYiVEJV36M+EEg03EzNn0tY6F OE298Fm5KJr7bVYXEh/VRvzRBCHjgST4YDiFKsqJSYiwjXK1JQt2QO5c45qlo= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:subject:from:to:date:content-type:mime-version; s= default; bh=MBebhC8tzT5Nw5VjI3GTfTqVDMs=; b=tCYsLiEiSN1ECEaaslrU xdRdlaUjVcGt+vg/NdkPr24JF3zETU8gqR1CnSSeXzBNXbOni7p/TkPavjMwebYL UlowMwxiOKeeaLA4rAWEnBffxMpJjSl+fG2PcHCpLHtHmF1txtlFeip1rYYu2hnI z8WCRVGcSKfCh7qxRvsXVRs= Received: (qmail 53485 invoked by alias); 28 Sep 2019 08:44:29 -0000 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 Received: (qmail 53477 invoked by uid 89); 28 Sep 2019 08:44:29 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-5.5 required=5.0 tests=AWL, BAYES_00, FREEMAIL_FROM, GIT_PATCH_2, GIT_PATCH_3, KAM_NUMSUBJECT, RCVD_IN_DNSWL_NONE, RCVD_IN_JMF_BL, SPOOFED_FREEMAIL autolearn=ham version=3.3.1 spammy=H*MI:online, H*M:online, H*r:encrypted, all-gcc X-HELO: mailout02.t-online.de Received: from mailout02.t-online.de (HELO mailout02.t-online.de) (194.25.134.17) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Sat, 28 Sep 2019 08:44:27 +0000 Received: from fwd32.aul.t-online.de (fwd32.aul.t-online.de [172.20.26.144]) by mailout02.t-online.de (Postfix) with SMTP id 89CBD41CD876 for ; Sat, 28 Sep 2019 10:44:24 +0200 (CEST) Received: from yam-desktop (TbxjtBZrwhQZxpf9sCl4lhjNua8HPJDR2zoYLN2YDr+EeoLXkg6KHEb7zVetHvHZZb@[163.58.16.102]) by fwd32.t-online.de with (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384 encrypted) esmtp id 1iE8Kz-1eTT0K0; Sat, 28 Sep 2019 10:44:21 +0200 Message-ID: Subject: [SH][committed] Fix PR 80672 From: Oleg Endo To: gcc-patches Date: Sat, 28 Sep 2019 17:44:17 +0900 Mime-Version: 1.0 X-IsSubscribed: yes Hi, The attached patch fixes PR 80672. Tested by building the compiler with "make all-gcc" and manually invoking it and checking that the option is parsed as expected. Committed to trunk as r276240, GCC 9 as r276241, GCC 8 as r276242, GCC 7 as r276243. Cheers, Oleg gcc/ChangeLog PR target/80672 * config/sh/sh.c (parse_validate_atomic_model_option): Use std::string::compare instead of std::string::find. Index: gcc/config/sh/sh.c =================================================================== --- gcc/config/sh/sh.c (revision 276235) +++ gcc/config/sh/sh.c (working copy) @@ -734,7 +734,7 @@ { if (tokens[i] == "strict") ret.strict = true; - else if (tokens[i].find ("gbr-offset=") == 0) + else if (!tokens[i].compare (0, strlen ("gbr-offset="), "gbr-offset=")) { std::string offset_str = tokens[i].substr (strlen ("gbr-offset=")); ret.tcb_gbr_offset = integral_argument (offset_str.c_str ());