From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-yb1-xb30.google.com (mail-yb1-xb30.google.com [IPv6:2607:f8b0:4864:20::b30]) by sourceware.org (Postfix) with ESMTPS id 6A6A63858C41 for ; Tue, 5 Mar 2024 04:52:22 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6A6A63858C41 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6A6A63858C41 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2607:f8b0:4864:20::b30 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709614344; cv=none; b=xyv+Y5jP1SeBQ8WkewOomcOT3qJTXHM6Q6LZZIOGxUwfSW4+1JLf4qs9qsxZ+2lvLwYpljxMpJKsB6ACMC4MrCJtBtYJ6EVv9GpG2rmtuxZyUDBXIxnYt13CECkElBAVAMnOBQZkquEr1CTKx5Ilu3oOh94Lq/JYiyiSe8mA0qw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1709614344; c=relaxed/simple; bh=vmrXt76nRxTPXr0Unzrzjg1VAvcyxkUN/R052u193Fo=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=UiVUJe3fsc912wdLCBXcnFcA2GCNaWqaOR2J1I9YEvNAF5LWyDuBfz1ZNjQXSEzRrTn7pABUtbgORcMnGPLdTGqtunC9Mmq9v0YlbDd28zl1fCBUXqre/FzY/hwd9urweMA3O39zca/B0BVBoaaTvZCiueYBA0q8TLZv4nUqAtA= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-yb1-xb30.google.com with SMTP id 3f1490d57ef6-dcc80d6006aso5454496276.0 for ; Mon, 04 Mar 2024 20:52:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1709614342; x=1710219142; darn=gcc.gnu.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=TNlhgFTT+yRHX66/7lHRf2sPwFP1ASoPKY74J95yWJY=; b=PcrKf3fEcM4f0ODn2sLeD5Gx4x0TsCB3/7Vr21bkOemUlbo7FQBIIp5+Fd+QwXOk/6 SZgFlyj5hl/MfpjNg++AoR8qn16MhHf+/QFt7XArE/jM6c/yCqE/It5z4PNTDeod0+b1 NUO7Jg/mUXW7Uj/+X53rZyrMIYqrcWXC6ffPNwuOpQ59htspe/LnAydkEw6foRjBgV0s 7h7BM6oLFs7ui8TQzqTM/GamwfIllWg1eHDY7X7Oyodv759LrQtWa7lin+XCgnlwmARj r8Kgsv+DBzkhhPg/Amql7HBKsG7eiQXiqDdPbEdAUSrt9idLwG58PzAEd7CQPIGxNkZ7 FcMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1709614342; x=1710219142; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=TNlhgFTT+yRHX66/7lHRf2sPwFP1ASoPKY74J95yWJY=; b=a+6w9wWLJWwm4h7DB6ztjZr4QlsmBDw6xFsmRc8BMwdnzaeQjUF6wY5OfVyAI0ln6m +F5b5FKb3WUytRJ+eBZACtmPxfS6zXF/StwS4UrNWxVW0/xNPVzsPGAVfO16afwGsqbD BY5OC/tmDkfvlyGn1Nua12XkmnYlqilupTDynIJmEie2BEv2lf/M9FVgCOVDQ/Fj06/C 7qLpqPnx/yDZzCIJ7zxFGig/H7QCga2Jh3vdZsZ7DMEb/Iri4hqyPEX0McyWTKAxSUSR x/WF61XnFc+24dT3hUjbmZramE6y5W4KmSnAd1XjvAUQp96R2WOMrMxSTmCi0MxNsSOb Lo7Q== X-Forwarded-Encrypted: i=1; AJvYcCU4IAy1982VyOb0qFYpV2CX11hFovZ0pockPqrHSpvWXOB1PjS9Tn8MvBsdidPD5ilRiFpfJ1Ewu2y6d3rT/wRFnaizpEAsfQ== X-Gm-Message-State: AOJu0YziGNhMWVk2iVilk/n/B3QtVkcb5SPJadKdBmtFN8olZMGqEEiP RPu2Evijr1l/qeN2xX40/oNLY5/Q8NYwbk8dE7pnMS2pVjNQPsfY7EPbpvVLofLi0peizsDw0PS BV/1OkxqtfbCM8m1cOM/BlTDIzVo= X-Google-Smtp-Source: AGHT+IEeZPF4TVOJ2+g96PHmDHBbsNWNrev0oe2Dr0umMDMHdJObGjjQPgez/YqV9yvMqfDF45WYZwJ0c+LCILlr3sA= X-Received: by 2002:a25:ac5e:0:b0:dcb:e0dc:67ee with SMTP id r30-20020a25ac5e000000b00dcbe0dc67eemr7850389ybd.45.1709614341783; Mon, 04 Mar 2024 20:52:21 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Hongtao Liu Date: Tue, 5 Mar 2024 12:52:09 +0800 Message-ID: Subject: Re: [PATCH] i386: Guard noreturn no-callee-saved-registers optimization with -mnoreturn-no-callee-saved-registers [PR38534] To: Jakub Jelinek Cc: Richard Biener , Uros Bizjak , hjl.tools@gmail.com, Jan Hubicka , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.0 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,T_SCC_BODY_TEXT_LINE 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 Thu, Feb 29, 2024 at 2:20=E2=80=AFPM Hongtao Liu wr= ote: > > On Wed, Feb 28, 2024 at 4:54=E2=80=AFPM Jakub Jelinek = wrote: > > > > Hi! > > > > Adding Hongtao and Honza into the loop as the ones who acked the origin= al > > patch. > > > > The no_callee_saved_registers by default for noreturn functions change = can > > break in-process backtrace(3) or backtraces from debugger or other proc= ess > > (quite often, any time the noreturn function decides to use the bp regi= ster > > and any of the parent frames uses a frame pointer; the unwinder just cr= ashes > > in the libgcc unwinder case, gdb prints stack corrupted message), so I'= d > > like to save bp register in that case: > > > > https://gcc.gnu.org/pipermail/gcc-patches/2024-February/646591.html > I think this patch makes sense and LGTM, we save and restore frame > pointer for noreturn. > > > > and additionally the no_callee_saved_registers by default for noreturn > > functions change can make debugging harder, again not localized to the > > noreturn function, but any of its callers. So, if say glibc abort func= tion > > implementation needs a lot of normally callee-saved registers, no matte= r how > > users recompile their apps, they will see garbage or optimized out > > vars/parameters in their code unless they rebuild their glibc with -O0. > > So, I think we should guard that by a non-default option: >From what has been discussed so far, I am inclined to this proposal. If there are no additional objections(or concerns) in a few days, ok for the trunk. > > > > > -- > BR, > Hongtao --=20 BR, Hongtao