From patchwork Tue Jul 16 11:18:12 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Christoph_M=C3=BCllner?= X-Patchwork-Id: 1961019 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=vrull.eu header.i=@vrull.eu header.a=rsa-sha256 header.s=google header.b=rgonpWk/; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4WNc5Y1ZFHz20FN for ; Tue, 16 Jul 2024 21:18:57 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 6A54B384A4BA for ; Tue, 16 Jul 2024 11:18:55 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-lj1-x230.google.com (mail-lj1-x230.google.com [IPv6:2a00:1450:4864:20::230]) by sourceware.org (Postfix) with ESMTPS id 40894385E836 for ; Tue, 16 Jul 2024 11:18:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 40894385E836 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=vrull.eu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=vrull.eu ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 40894385E836 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::230 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721128706; cv=none; b=mpjRqzMk62Z89ZHia1hHaOebmKCmQCdgTWihfFjDsOtnq73Uq8FzVnuod/44wiJx3aAUrSPIo/m08PlzMiJl6D1/3mQhkFplkWv79au4fbgVI1R9NJaTtG0UGDq9j8oAqSfyQnv/U8hsEzQAirYwdcY1nyamTE+kEtzLqB14WIQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1721128706; c=relaxed/simple; bh=rZVRlZPjwDEZlzPokklXdDEYDJ2ejUUoHLif8mPR72c=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=E97G0WVhIUv6Oz4qSqcsbtJMhaj9y2oftI8Bb8SiiBxmSHD2+Qp+uhY8xXp5PqHaxeq9CWLIduiKJaoe6pV71Nl3wCedm7ZHKJgsGhiIjqWfvUC3eRRVflHf2OapLx4Ts2Xm2KrIm6qBGp3n1eKFNMf9+DFUajo9vjYmWSMAJiY= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-lj1-x230.google.com with SMTP id 38308e7fff4ca-2eecd2c6432so75577401fa.3 for ; Tue, 16 Jul 2024 04:18:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vrull.eu; s=google; t=1721128702; x=1721733502; darn=gcc.gnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3O/bfNrS3N5BOI5Y4mVWEloTk+8Z95JmeLhzmgg+PF4=; b=rgonpWk/+9Vh90rrNHoVB0Ya5WPxqfA5HXRpic3czRGMN4zugyEEY3tplV+LSW7B6S 40Rt40OT+DWcEkVB8t+2FoK5MdeDEmiwYWKzU+aLHKjn3QjmiN+983uMKuLvQmNP5Dub ExrLXis9lqRMW4r5nOu1Md6Z+frUcvm5MO8/iqJ131rtxLTpmntY0h/1QqPCaP8vRKNp 6/A6nZbYVgC93IojfyBOxfV9VmuWjEWVwp2CS0n3NhieRBw2a1ylPUD/flyZtuksgENt yVK5jkXAauAD8cs7NMVehb/a8NhbooBIReGouixCmsItdS86Q+oHaWQgfRecZ4GFvKuy L6fA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1721128702; x=1721733502; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3O/bfNrS3N5BOI5Y4mVWEloTk+8Z95JmeLhzmgg+PF4=; b=qVgitO1tnjkDroOClpNqqsnHvUildQTin6M8K2g7c37F3yLSuVLyH0M2IG3LgZ4l04 eZzERkS4WzW7HHlj8mnVaI8PtOo3oNACtDq+NK0Fee11TnQ3+MalAj3O476wqMMlnjqc kY0vT5nATEqdXXwLNHT6d+tJy6YgSzzKOdzdqg/wablBUrz7Nm1XFLGfX+Ig6lAJKp7f fvlXxaC2bPmqfOXwc3Ea67s412hhNY+xqr5XUBzbADxQWbXvMiEiTjCOk8Q75740nBbm rDFB7miftMEOh0VOebYSRlnnOyjGLsYFNyF5hSZc/krFGiPMlXCgb+iTTN423wMvXUga 1QxQ== X-Gm-Message-State: AOJu0YxJrX+pd+P8jjwal5Q/IWOGR9LSEQGnP+8zgG1FTHKn3NIt2Q45 cPLuB6jh+++ypUbUgHuB2dhjFxM3TVY/tWRUNOwVF4/h7HAjnkcgCgO62eJllay+GxYtwLXpQzv 1Pjw= X-Google-Smtp-Source: AGHT+IHM+yBwmscZKiyukYxcundyQLx8BVqy+AN4UU6WuKy4Jmsldx3ms9BCHhShWnfBLNurHmezFQ== X-Received: by 2002:a05:651c:2205:b0:2ee:87b9:91a8 with SMTP id 38308e7fff4ca-2eef416dc20mr18069561fa.19.1721128701985; Tue, 16 Jul 2024 04:18:21 -0700 (PDT) Received: from antares.fritz.box (62-178-148-172.cable.dynamic.surfer.at. [62.178.148.172]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a79bc820dfbsm297952166b.211.2024.07.16.04.18.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jul 2024 04:18:21 -0700 (PDT) From: =?utf-8?q?Christoph_M=C3=BCllner?= To: gcc-patches@gcc.gnu.org, Kito Cheng , Jim Wilson , Palmer Dabbelt , Andrew Waterman , Philipp Tomsich , Jeff Law , Vineet Gupta , Pan Li , Patrick O'Neill Cc: =?utf-8?q?Christoph_M=C3=BCllner?= Subject: [committed][GCC-14] RISC-V: Fix comment/naming in attribute parsing code Date: Tue, 16 Jul 2024 13:18:12 +0200 Message-ID: <20240716111815.129028-3-christoph.muellner@vrull.eu> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240716111815.129028-1-christoph.muellner@vrull.eu> References: <20240716111815.129028-1-christoph.muellner@vrull.eu> MIME-Version: 1.0 X-Spam-Status: No, score=-12.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org Function target attributes have to be separated by semi-colons. Let's fix the comment and variable naming to better explain what the code does. gcc/ChangeLog: * config/riscv/riscv-target-attr.cc (riscv_process_target_attr): Fix comments and variable names. (cherry picked from commit 5ef0b7d2048a7142174ee3e8e021fc1a9c3e3334) Signed-off-by: Christoph Müllner --- gcc/config/riscv/riscv-target-attr.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/riscv-target-attr.cc b/gcc/config/riscv/riscv-target-attr.cc index 19eb7b06d54..0bbe7df25d1 100644 --- a/gcc/config/riscv/riscv-target-attr.cc +++ b/gcc/config/riscv/riscv-target-attr.cc @@ -338,11 +338,11 @@ riscv_process_target_attr (tree fndecl, tree args, location_t loc, char *str_to_check = buf.get (); strcpy (str_to_check, TREE_STRING_POINTER (args)); - /* Used to catch empty spaces between commas i.e. + /* Used to catch empty spaces between semi-colons i.e. attribute ((target ("attr1;;attr2"))). */ - unsigned int num_commas = num_occurences_in_str (';', str_to_check); + unsigned int num_semicolons = num_occurences_in_str (';', str_to_check); - /* Handle multiple target attributes separated by ','. */ + /* Handle multiple target attributes separated by ';'. */ char *token = strtok_r (str_to_check, ";", &str_to_check); riscv_target_attr_parser attr_parser (loc); @@ -354,7 +354,7 @@ riscv_process_target_attr (tree fndecl, tree args, location_t loc, token = strtok_r (NULL, ";", &str_to_check); } - if (num_attrs != num_commas + 1) + if (num_attrs != num_semicolons + 1) { error_at (loc, "malformed % attribute", TREE_STRING_POINTER (args));