From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) by sourceware.org (Postfix) with ESMTPS id BF515385828D for ; Wed, 27 Sep 2023 20:14:17 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF515385828D Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-io1-xd29.google.com with SMTP id ca18e2360f4ac-79fa891b645so338649439f.0 for ; Wed, 27 Sep 2023 13:14:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1695845657; x=1696450457; darn=gcc.gnu.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=OqR93hLRfDUCUM/MV2EdP7oIKDouXHwnQrtlfOacscc=; b=RYmbmjvhb85SHI0BjVD4cvuZLho4BOsgyCO2wkPCEBPOY7bKvF+VtAvK7a7ZlTYlK3 TPW8RWr+sDT4leZLdgkesqWHl893Z+7syZMG/eLmotyJMfau1+AN6AmKIetEX1H+UJBn i46DoNcvA6fKElp/ZCI3dCFkPy1jpYjrNxSD1lBQokzBcXo6pgD/qwfHd9wARKVzsICU 5Mh5pSjBMZaQBAV/yTzk+QDcJdT5IQglal8ZPjS10TSwHeSzGv7tzd3dq3MUb8v4aT/g aUjtWnomIwgeuff9s2SGjwr0x6eyWXpcDwPpw+X6OsogBoyzZwRjaSqcMRoe4so0OZt8 lGJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695845657; x=1696450457; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OqR93hLRfDUCUM/MV2EdP7oIKDouXHwnQrtlfOacscc=; b=O6zs0y2N8/palKzDhSsv79hRRdZsWCQWE9Vpn6QbzLaJP2TOTEUzj/C5wN7dktKCZC t/baMVCIwIJ4wx4f4khfZExfQm6A5m5wI5Gpyk5kYnN1IAlOUPPp8MWbLpE2Vl/GT31X sSsP3crlaYwNok4LZUL0A2M79wJQfgD/tQ1NZBTW8gmmOwDhCD4GVBdJGn2B5rZU8ls5 NiFsz0a/HXtac66u885EkDXmok9Gt8bgkycs/4GCBmV3ifNhkjrfwWjZfmR+g3Bb66ka mhppybJWrUGC08z584tUVOLtNscjsZYszFuqmM0MgsQsvW62VMtiErz2GL2m20Y/OQBn ubJg== X-Gm-Message-State: AOJu0YzYpJn0OYdLz20wczU+iXuREsJ/XI0pWm9I3DZiiGDg9KYoBpac 9SjPHhRthzT4EUlu23NQRrA= X-Google-Smtp-Source: AGHT+IFIprKJ+WMpqg493/shm1oHsjAIEQ5XNvoXCaJLL2ZU2zY9uxy0O+uyfpgQZM7GF71aothxHw== X-Received: by 2002:a5d:8f96:0:b0:792:4cfc:178f with SMTP id l22-20020a5d8f96000000b007924cfc178fmr3469092iol.16.1695845656845; Wed, 27 Sep 2023 13:14:16 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id el21-20020a0566384d9500b0041e328a2084sm4094676jab.79.2023.09.27.13.14.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 27 Sep 2023 13:14:16 -0700 (PDT) Message-ID: Date: Wed, 27 Sep 2023 14:14:14 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: committed [RISC-V]: Harden test scan patterns Content-Language: en-US To: Joern Rennecke Cc: GCC Patches References: <2501e6a4-6f02-429f-8497-226a6b22403c@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=1.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,KAM_TK,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 9/27/23 12:22, Joern Rennecke wrote: > On Wed, 27 Sept 2023 at 18:22, Jeff Law wrote: > >> It would help to describe how these patterns were under specified so >> that folks don't continue to make the same mistake as new tests get added. > > dg-final scan-assembler, scan-assembler-not, and scan-assembler-times > use a tcl regular expression (often referred to abbreviated as RE), as > described in https://www.tcl.tk/man/tcl8.4/TclCmd/re_syntax.html . > > If your RE is not specific enough, it can match LTO information that the > compiler places into its assembly output when the relevant options are > provided, which is common when running tests where the test harness > iterates over a number of optimization option combinations. > Note that '.' is an atom that can match any character. If you want to > match a dot specifically, you have to escape it with a backslash: '\.' . > When you are matching an instruction mnemonic, an effective way to > avoid matching in LTO information is to enforce matching of word start > (\m) and/or word end (\M) . > Note also that the backslash has to be quoted. If the RE is enclosed in > '"' quotes, extra backslashes are needed. That is not necessary when it > is enclosed in curly braces. > > For example, "ld.w" will be matched in: > > .ascii "h\227\022\212ld@w\251jr\254'\320\255vwj\252\026\016\364" > > If you write {\mld\.w\M} instead, you avoid this problem. OK. So that naturally leads to the question, why aren't others seeing this, both in the RISC-V world and more generally. I'm not aware of any case where I've run the testsuite and tripped over this issue, nor am I aware of anyone else tripping over it. Jeff