From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yw1-x1129.google.com (mail-yw1-x1129.google.com [IPv6:2607:f8b0:4864:20::1129]) by sourceware.org (Postfix) with ESMTPS id B28E63858C78 for ; Fri, 29 Sep 2023 16:49:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B28E63858C78 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-yw1-x1129.google.com with SMTP id 00721157ae682-59f57ad6126so134144387b3.3 for ; Fri, 29 Sep 2023 09:49:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696006150; x=1696610950; 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=m6VRxSdckrcUQWsGB48dSoNM2lwkcRJ7pFtBab6OmOc=; b=SARWt6ji5DO1s8IzWoh2Qx2CahCnmdAQWKPigbKvQ0Wj6LlHhldA0CVVy80oVa7qfc EVfV0+uJg3BfcK1T1lEnv+QT+IJdUxmI9MHfppPc6mEzzPjI8C23tCUH2eeCoc8TsKwe TFNnGjbZVxf8yYdRQAYANHYgyDHwrZnmbIKJnEZ+NR726bggG6zD+rg4gM1cABz4YhC+ cxJ7Zzn54bnzuxLAHjARg78F3mwUvNjdJEGmaRp7z9mOnVsqFTwoMaOo6C18jy+E8Bah QbscrPd8Mnj1VqbOR3X6KsdaMrSd/HNeP/4GXyuF6Uf067/hbOFJMg56x+cGPSCljnmB ex1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696006150; x=1696610950; 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=m6VRxSdckrcUQWsGB48dSoNM2lwkcRJ7pFtBab6OmOc=; b=avZifnz1S5rzcVkI1HCErxrHEWRY4MDY81f8Y9CeLyrqQUIj/Q4mpr2RanXidhTJRq J0swG8JflNl3Gcs6Cgw0Rbjwe69+vlbqMreeCtG3wxeS0lfMNEoSHae8z0ZvesBHoMT2 EjUfuvRyGlL7CNiE+X0DxyYDQLxMcK/TAQ7vhHU2xQU/CvSSpNG99PhA5Fhr69tTxQhW qo24H4BFzDszQc4q/B6WBHz+33CvWxKtxty38rfDGxHbYdpC+p5Ei5OYUkBy9AU402Pg cbhYrEON/joBn2Dtjc1EmyrsG5fZ3OuSRfRU0LlfzIm5fenwe75xAr6F20+BlDM9b27f 4UJQ== X-Gm-Message-State: AOJu0YxPe5G3OAzHAJ/oOumsVE2WMe5zC8BhGiuHaJZ5dv3oKuxlAioF BzIqSrnxOVW5KWcYi6g2poM= X-Google-Smtp-Source: AGHT+IHUQ56MI1XCg82y2RRIO33Ffu9UQXItL3+HnxraaogeAanwH2ErijbbiveeliXenTMkwllRRA== X-Received: by 2002:a81:8392:0:b0:59f:7f8e:dc4a with SMTP id t140-20020a818392000000b0059f7f8edc4amr5229325ywf.22.1696006149792; Fri, 29 Sep 2023 09:49:09 -0700 (PDT) Received: from [172.31.0.109] ([136.36.130.248]) by smtp.gmail.com with ESMTPSA id g1-20020a81ae41000000b0059f766f9750sm3823038ywk.124.2023.09.29.09.49.08 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 29 Sep 2023 09:49:09 -0700 (PDT) Message-ID: Date: Fri, 29 Sep 2023 10:49:07 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] Testsuite, DWARF2: adjust regexp to match darwin output Content-Language: en-US To: FX Coudert , GCC Patches Cc: Iain Sandoe References: <9A5AB3A9-0C58-4BDB-B2B2-8407C49B44CB@gmail.com> From: Jeff Law In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,KAM_SHORT,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 List-Id: On 9/20/23 07:53, FX Coudert wrote: > ping**2 > > >> Hi, >> >> This was a painful one to fix, because I hate regexps, especially when they are quoted. On darwin, we have this failure: >> >> FAIL: gcc.dg/debug/dwarf2/inline4.c scan-assembler DW_TAG_inlined_subroutine[^\\\\(]*\\\\([^\\\\)]*\\\\)[^\\\\(]*\\\\(DIE \\\\(0x[0-9a-f]*\\\\) DW_TAG_formal_parameter[^\\\\(]*\\\\(DIE \\\\(0x[0-9a-f]*\\\\) DW_TAG_variable >> >> That hideous regexp is trying to match (generated on Linux): >> >>> .uleb128 0x4 # (DIE (0x5c) DW_TAG_inlined_subroutine) >>> .long 0xa0 # DW_AT_abstract_origin >>> .quad .LBI4 # DW_AT_entry_pc >>> .byte .LVU2 # DW_AT_GNU_entry_view >>> .quad .LBB4 # DW_AT_low_pc >>> .quad .LBE4-.LBB4 # DW_AT_high_pc >>> .byte 0x1 # DW_AT_call_file (u.c) >>> .byte 0xf # DW_AT_call_line >>> .byte 0x14 # DW_AT_call_column >>> .uleb128 0x5 # (DIE (0x7d) DW_TAG_formal_parameter) >>> .long 0xad # DW_AT_abstract_origin >>> .long .LLST0 # DW_AT_location >>> .long .LVUS0 # DW_AT_GNU_locviews >>> .uleb128 0x6 # (DIE (0x8a) DW_TAG_variable) >> >> It is using the parentheses to check what is between DW_TAG_inlined_subroutine, DW_TAG_formal_parameter and DW_TAG_variable. There’s only one block of parentheses in the middle, that "(u.c)”. However, on darwin, the generated output is more compact: >> >>> .uleb128 0x4 ; (DIE (0x188) DW_TAG_inlined_subroutine) >>> .long 0x1b8 ; DW_AT_abstract_origin >>> .quad LBB4 ; DW_AT_low_pc >>> .quad LBE4 ; DW_AT_high_pc >>> .uleb128 0x5 ; (DIE (0x19d) DW_TAG_formal_parameter) >>> .long 0x1c6 ; DW_AT_abstract_origin >>> .uleb128 0x6 ; (DIE (0x1a2) DW_TAG_variable) >> >> I think that’s valid as well, and the test should pass (what the test really wants to check is that there is no DW_TAG_lexical_block emitted there, see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=37801 for its origin). It could be achieved in two ways: >> >> 1. making darwin emit the DW_AT_call_file >> 2. adjusting the regexp to match, making the internal block of parentheses optional >> >> I chose the second approach. It makes the test pass on darwin. If someone can test it on linux, it’d be appreciated :) I don’t have ready access to such a system right now. >> >> Once that passes, OK to commit? I actually tested the change on a few embedded targets (rx-elf, bfin-elf, visium-elf and lm32-elf). For this change, that should be sufficient. OK for the trunk, sorry for the delay. jeff