From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4QrCNBKobGrHlTcAWB0awg (envelope-from ) for ; Fri, 31 Jul 2026 09:50:10 -0400 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=f3o1xXDC; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id D3D011E099; Fri, 31 Jul 2026 09:50:10 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-6.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [IPv6:2620:52:6:3111::32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 1214A1E099 for ; Fri, 31 Jul 2026 09:50:10 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DD224BB588E for ; Fri, 31 Jul 2026 13:50:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9DD224BB588E Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=f3o1xXDC Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTP id CB87F4BB1C12 for ; Fri, 31 Jul 2026 13:49:37 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org CB87F4BB1C12 Authentication-Results: sourceware.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org CB87F4BB1C12 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785505777; cv=none; b=uLB8nIEMojWAK0fbTDWRdDesoroy8W3ljUT9bJ9YWMgHOPg3kbFCkR6r0gZREDXRP3RTyvNRt6EFOAbtCy9AqeExnwDC1l9YESQ+1OZBLSq0skQcZz3mR6tP01Ptf3eVmA53Y9uaDZOHXGwRn30AjbaeH5HBFWLaqj70bntXd3E= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1785505777; c=relaxed/simple; bh=2lbMW3ZD7Ii5gTa8BDmcGmyXTIGVxzZ8ai/r9Wl2yTE=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=ETlCd6cq4ZCujRbJJ6jaPqNGGihQhRHlYlCkCA+FsSk6xroT66s2pf8wou0Z2e8WOX10UtNf9oZvAsZs9UMDHjbmcUrNizfdOSa2FhYvsXvswO1DQJqVyVOXGhQ9p+XMvI0fE/x+aURPfdWdXKOC8osSzwlT79rfv2HUw4QzCQ8= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=f3o1xXDC DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org CB87F4BB1C12 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1785505777; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=sp5oiGvONBcfUp7rmZ/KwieIltu+FKTO+mZ9bS8+5G0=; b=f3o1xXDCRHyMcZrD1iwQzioWZ64/5HYtQTQSTqfwvHa92iv5f6qf98unujqEUyqbaaNV0j RqeROuRoW5jDlvBo5R9/+SNgDqZBEaI5rjT2xUxGE8l79YxrWMRwMuuWqIwLrbk1dCGgcB 7a46AritjoZ2lEqXO+X37qMvzInkU7U= Received: from mail-wr1-f71.google.com (mail-wr1-f71.google.com [209.85.221.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-338-WurQO9u7NjqbyebGTdvKUg-1; Fri, 31 Jul 2026 09:49:32 -0400 X-MC-Unique: WurQO9u7NjqbyebGTdvKUg-1 X-Mimecast-MFC-AGG-ID: WurQO9u7NjqbyebGTdvKUg_1785505771 Received: by mail-wr1-f71.google.com with SMTP id ffacd0b85a97d-47485fde05aso896368f8f.0 for ; Fri, 31 Jul 2026 06:49:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1785505771; x=1786110571; h=content-type:mime-version:message-id:date:references:in-reply-to :subject:to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=sp5oiGvONBcfUp7rmZ/KwieIltu+FKTO+mZ9bS8+5G0=; b=BaKdrJNrzeNOhbAIjaDRhqa+KRxuzSOQMnL4DQRcNm/L+aho0Qncueb8Ytk/oY0R6L EPIDxUIo0qzg7ab+ljOrIzRZC9g34Wt/UTq0gLPmy3KCNRKH+CgUOLp7bv/0UBLGcXbV VmamIruVRBSBuYQhLRTrqMqgSVJe9bTrNtIFo20uvaaZIFeyUdu5tDeJZ4C/byan0yGz +He8NzoflboA0Ka7eRL3fYUS3jE/h5iKbGcAfulujZRb3qCtQw2kmh74TjR5we4p0XRn n2QSWc3D5Wm8Rc7aVCCd+0aFa0T4cxruWoBbsRcX9BCq3V0crepucIj3b80lmhwXef11 t26g== X-Forwarded-Encrypted: i=1; AHgh+Rq8upcykQtYvwGPH23Wn0FE/ReMDA2KWbFhDFaOGJ/2p13Oyj8A9lRZ7fW1xeUNz3EfYF9WwFn32sykFw==@sourceware.org X-Gm-Message-State: AOJu0YwurShejKPeOAiCdprTz7rKif7kHpxZx3kRwnMr7I4L2w3BTgYD OSi6B5gyBTzn8b8G0f4H6G8TynBHp76XASezrmamkqHfrPKxV9ldENNNPiQ/rp3dU//fV7rIoOA 6e3UkDMsf/d5qS0lkjI7xie5+1u7NZm5ZHOqwL1VFl563dS8rEiB8JaxIvi62XZk= X-Gm-Gg: AR+sD13LwTMAMhf1SH12jAGseSvYR2GOnuILbUzIxXjgVhXLhrAnzq184mzaP2enxcU weoDD3Go7tQkmF9P/Ktfg13z3s40reJGMXjJK3mFSuKX8oHUNiR1/R9SNTy6rqSfEg5mp9IXbgb eOpqie7kFzsXHJ+OSL2R4aiWqqAmg3Z0b5o5Ku2YyA6Z0sBnnOM5P15Yvi3auij6U8dRUfJC7Rs Ygglf6s4fNIqFey38TebJjpmvg6/mVhFWh5vF/v6EzfZ1gRce5Et5h6xjrtQaC5OGgR6LXFbtV5 ZJMEE7ba//Dsn+32VP73gkVBGLQ3Mh62/fT3jKUm8Khv5jEJdDACCI81gw/BIKEoqvN/bVAZWc+ xlBqHhP0oGj8uYMFy X-Received: by 2002:a5d:5e84:0:b0:47f:854b:5c68 with SMTP id ffacd0b85a97d-47fd2b5ae60mr4737657f8f.55.1785505770867; Fri, 31 Jul 2026 06:49:30 -0700 (PDT) X-Received: by 2002:a5d:5e84:0:b0:47f:854b:5c68 with SMTP id ffacd0b85a97d-47fd2b5ae60mr4737614f8f.55.1785505770427; Fri, 31 Jul 2026 06:49:30 -0700 (PDT) Received: from localhost (92.6.93.209.dyn.plus.net. [209.93.6.92]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-47fd458ea4asm4932749f8f.31.2026.07.31.06.49.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 Jul 2026 06:49:29 -0700 (PDT) From: Andrew Burgess To: Tom de Vries , gdb-patches@sourceware.org Subject: Re: [PATCH] [gdb/testsuite] Fix gdb.python/py-finish-breakpoint-tailcall.exp with gcc 16 In-Reply-To: <20260731093508.3717972-1-tdevries@suse.de> References: <20260731093508.3717972-1-tdevries@suse.de> Date: Fri, 31 Jul 2026 14:49:29 +0100 Message-ID: <87o6fnmfpy.fsf@redhat.com> MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: ZZMKrhbSagGC0Re5lMEX3hwI0QJvvHqkxextxwWzW28_1785505771 X-Mimecast-Originator: redhat.com Content-Type: text/plain X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org Tom de Vries writes: > On openSUSE Leap 16.0, with gcc 15.3.0, for test-case > gdb.python/py-finish-breakpoint-tailcall.exp I get: > ... > (gdb) python MyFinishBreakpoint(frame) > Temporary breakpoint 2 at 0x40102a: file py-finish-breakpoint-tailcall.c, \ > line 43. > (gdb) PASS: $exp: parent_frame=true: create finish breakpoint > ... > > And on openSUSE Tumbleweed, with gcc 16.1.1 I get instead: > ... > (gdb) python MyFinishBreakpoint(frame) > Temporary breakpoint 2 at 0x40102a: file py-finish-breakpoint-tailcall.c, \ > line 44. > (gdb) FAIL: $exp: parent_frame=true: create finish breakpoint > ... > > The only difference is in the line numbers, 43 and 44, both in main: > ... > 39 int > 40 main (void) > 41 { > 42 int result = tailcall_function (42); > 43 result -= global_var; /* Temporary breakpoint here. */ > 44 return result; > 45 } > ... > > The executable is compiled with O2, and the code for main is different. > > With gcc 15, we have: > ... > 0000000000401020
: > 401020: bf 2a 00 00 00 mov $0x2a,%edi > 401025: e8 26 01 00 00 call 401150 > 40102a: 8b 15 e0 2f 00 00 mov 0x2fe0(%rip),%edx > 401030: 29 d0 sub %edx,%eax > 401032: c3 ret > ... > and the line number associated with 0x40102a, the first instruction after the > call is 43: > ... > File name Line number Starting address View Stmt > py-finish-breakpoint-tailcall.c 43 0x40102a x > ... > > With gcc 16, the mov and sub have been merged: > ... > 0000000000401020
: > 401020: bf 2a 00 00 00 mov $0x2a,%edi > 401025: e8 26 01 00 00 call 401150 > 40102a: 2b 05 e0 2f 00 00 sub 0x2fe0(%rip),%eax > 401030: c3 ret > ... > and the line number info is different: > ... > File name Line number Starting address View Stmt > py-finish-breakpoint-tailcall.c 43 0x40102a x > py-finish-breakpoint-tailcall.c 44 0x40102a 1 x > py-finish-breakpoint-tailcall.c 43 0x40102a 2 > ... > and gdb picks 44 in this case. > > Fix this by merging lines 43 and 44 in the test-case: > ... > - result -= global_var; /* Temporary breakpoint here. */ > - return result; > + return result - global_var; /* Temporary breakpoint here. */ > ... > > Tested on x86_64-linux. > > I've also verified that reverting the fix in commit e6bdfed6f5d ("gdb: fix > frame_unwind_caller_WHAT functions for inline and tail calls"), the commit > that introduced the test-case still makes the test-case fail. Thanks for taking the time to do this. This fix LGTM. Approved-By: Andrew Burgess Thanks, Andrew > > Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=33989 > --- > gdb/testsuite/gdb.python/py-finish-breakpoint-tailcall.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/gdb/testsuite/gdb.python/py-finish-breakpoint-tailcall.c b/gdb/testsuite/gdb.python/py-finish-breakpoint-tailcall.c > index d129d7e41b4..844ac1d2ea6 100644 > --- a/gdb/testsuite/gdb.python/py-finish-breakpoint-tailcall.c > +++ b/gdb/testsuite/gdb.python/py-finish-breakpoint-tailcall.c > @@ -40,6 +40,5 @@ int > main (void) > { > int result = tailcall_function (42); > - result -= global_var; /* Temporary breakpoint here. */ > - return result; > + return result - global_var; /* Temporary breakpoint here. */ > } > > base-commit: 6d1be0b90e837e4c82eaaf6f9e8c7da7227902e1 > -- > 2.51.0