From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by sourceware.org (Postfix) with ESMTPS id 68AA63858281 for ; Sun, 20 Aug 2023 10:55:57 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 68AA63858281 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-wm1-x330.google.com with SMTP id 5b1f17b1804b1-3fe5c552dd0so3507175e9.0 for ; Sun, 20 Aug 2023 03:55:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1692528956; x=1693133756; h=to:cc:date:message-id:subject:mime-version:from:from:to:cc:subject :date:message-id:reply-to; bh=nrLektu6bJ3pajesDl9X2wXatvwcSqw1dHQCQerZyJw=; b=f0Q94KgwCEiQrWutvKg/9XMCX5AW4e0Z6zaDdWs98mypa30/1f6Pp0zHzP1JFk7R9a kIz/OSBL8cSab6QsxRrZJBgRTLIm1Lq5Gg6w3+Pbr7ZBYwKUAW1QV5AoQQ4KxcF+fF/T CMgPAz3xReaDCLHcwlXpB4MfostCnhRqxzjo58h9fux2KZnbMVDBDGUAPJkWsKLoPthI DeA/rdvDiZT+yRsX8QZGQP46/pK+/zpcTGnwUEm5RmkqqVXtSyZy8jc1ydIqzFTFyFvm s7XRWyG1mVBDXM/tf6JRayMk3KyOSrTOH0+xpKeuJ/UuurdffPvd44zTs6k7T9xUvc15 M0jA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1692528956; x=1693133756; h=to:cc:date:message-id:subject:mime-version:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=nrLektu6bJ3pajesDl9X2wXatvwcSqw1dHQCQerZyJw=; b=O9acO0lwqB8LS4lwvkHcbtbD5twB2+8e+5UMjOsXkQ9kAPGugew730Pk180yf3oTwc 5cmyDqbif772ZQfdl6gDAgMeBE9RcGpK0FqATWvR1foZLBxPhRxfDqsTPgG1E85JQBHd CG88KSxQigwsMGJidYLVfo38LBbn0tWZlJ9NR5q5/TjG7c69oCeGAXRPTfELUM118117 zk92cx3VaaUDLdI/90yT8o6wkBaW8Jve35qFXA16JVuSwFZ+TMcbwzNXjBpPcEN/JYZF J6way84jwcRPBPJ1F9lNftGeV8Xh+M3m81WLoQgJ1PNZG6+iSyYdMXJUkqWnUU13oxuf wuSQ== X-Gm-Message-State: AOJu0YyxNpjk3zhgosMqOxkMPmJ1YTkQSmqcHnWHIK+x2t2R+XvEI4JT UzIhoOnniLgFzS8Gx5XU66mAgaryOvQ= X-Google-Smtp-Source: AGHT+IE/0HkmQ+EcWIiSKUTl6dw6G3ncV4YXXb5sU/e+k14IJvc0yIdXuW3W7a8OF4gOrmBDHFO86g== X-Received: by 2002:a5d:4692:0:b0:319:7295:31e with SMTP id u18-20020a5d4692000000b003197295031emr2534596wrq.4.1692528955998; Sun, 20 Aug 2023 03:55:55 -0700 (PDT) Received: from smtpclient.apple ([37.167.139.133]) by smtp.gmail.com with ESMTPSA id a14-20020adff7ce000000b0030fd03e3d25sm9059028wrq.75.2023.08.20.03.55.54 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Aug 2023 03:55:55 -0700 (PDT) From: FX Coudert Content-Type: multipart/mixed; boundary="Apple-Mail=_39B39875-ADA9-4580-9504-C1A54272815A" Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.600.7\)) Subject: [PATCH] Testsuite, DWARF2: adjust regexp to match darwin output Message-Id: <9A5AB3A9-0C58-4BDB-B2B2-8407C49B44CB@gmail.com> Date: Sun, 20 Aug 2023 12:55:44 +0200 Cc: Iain Sandoe To: gcc-patches@gcc.gnu.org X-Mailer: Apple Mail (2.3731.600.7) X-Spam-Status: No, score=-1.7 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: --Apple-Mail=_39B39875-ADA9-4580-9504-C1A54272815A Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 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=E2=80=99s only one block of parentheses in the middle, that = "(u.c)=E2=80=9D. 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=E2=80=99s 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=3D37801 = 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=20 I chose the second approach. It makes the test pass on darwin. If = someone can test it on linux, it=E2=80=99d be appreciated :) I don=E2=80=99= t have ready access to such a system right now. Once that passes, OK to commit? FX --Apple-Mail=_39B39875-ADA9-4580-9504-C1A54272815A Content-Disposition: attachment; filename=0001-Testsuite-DWARF2-adjust-regexp-to-match-darwin-outpu.patch Content-Type: application/octet-stream; x-unix-mode=0644; name="0001-Testsuite-DWARF2-adjust-regexp-to-match-darwin-outpu.patch" Content-Transfer-Encoding: quoted-printable =46rom=20f5b8d46bb89ee7664731e611d937ddbbf58d9f6b=20Mon=20Sep=2017=20= 00:00:00=202001=0AFrom:=20Francois-Xavier=20Coudert=20= =0ADate:=20Sun,=2020=20Aug=202023=2012:53:19=20= +0200=0ASubject:=20[PATCH]=20Testsuite,=20DWARF2:=20adjust=20regexp=20to=20= match=20darwin=20output=0A=0Agcc/testsuite/ChangeLog:=0A=0A=09*=20= gcc.dg/debug/dwarf2/inline4.c:=20Ajdust=20regexp=20to=20match=20darwin=0A= =09output.=0A---=0A=20gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c=20|=20= 2=20+-=0A=201=20file=20changed,=201=20insertion(+),=201=20deletion(-)=0A=0A= diff=20--git=20a/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c=20= b/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c=0Aindex=20= 2faef6e2a4f..22eb35fcf09=20100644=0A---=20= a/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c=0A+++=20= b/gcc/testsuite/gcc.dg/debug/dwarf2/inline4.c=0A@@=20-2,7=20+2,7=20@@=0A=20= =20=20=20the=20DW_TAG_inlined_subroutine=20and=20the=20DW_TAG_variable=20= for=20the=20local.=20=20*/=0A=20/*=20{=20dg-options=20"-O=20-gdwarf=20= -dA"=20}=20*/=0A=20/*=20{=20dg-do=20compile=20}=20*/=0A-/*=20{=20= dg-final=20{=20scan-assembler=20= "DW_TAG_inlined_subroutine\[^\\(\]*\\(\[^\\)\]*\\)\[^\\(\]*\\(DIE=20= \\(0x\[0-9a-f\]*\\)=20DW_TAG_formal_parameter\[^\\(\]*\\(DIE=20= \\(0x\[0-9a-f\]*\\)=20DW_TAG_variable"=20}=20}=20*/=0A+/*=20{=20dg-final=20= {=20scan-assembler=20= "DW_TAG_inlined_subroutine\[^\\(\]*\(\|\\(\[^\\)\]*\\)\)\[^\\(\]*\\(DIE=20= \\(0x\[0-9a-f\]*\\)=20DW_TAG_formal_parameter\[^\\(\]*\\(DIE=20= \\(0x\[0-9a-f\]*\\)=20DW_TAG_variable"=20}=20}=20*/=0A=20/*=20{=20= dg-final=20{=20scan-assembler-times=20"DW_TAG_inlined_subroutine"=202=20= }=20}=20*/=0A=20=0A=20static=20int=20foo=20(int=20i)=0A--=20=0A2.39.2=20= (Apple=20Git-143)=0A=0A= --Apple-Mail=_39B39875-ADA9-4580-9504-C1A54272815A--