From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14119 invoked by alias); 6 Aug 2008 17:52:14 -0000 Received: (qmail 14104 invoked by uid 22791); 6 Aug 2008 17:52:13 -0000 X-Spam-Check-By: sourceware.org Received: from us02smtp1.synopsys.com (HELO vaxjo.synopsys.com) (198.182.60.75) by sourceware.org (qpsmtpd/0.31) with ESMTP; Wed, 06 Aug 2008 17:51:34 +0000 Received: from crone.synopsys.com (crone.synopsys.com [146.225.7.23]) by vaxjo.synopsys.com (Postfix) with ESMTP id 9E3C6DC17; Wed, 6 Aug 2008 10:51:32 -0700 (PDT) Received: from venkatar-opt-lnx.internal.synopsys.com (localhost [127.0.0.1]) by crone.synopsys.com (8.9.1/8.9.1) with ESMTP id KAA02984; Wed, 6 Aug 2008 10:51:32 -0700 (PDT) Received: from venkatar-opt-lnx.internal.synopsys.com (localhost.localdomain [127.0.0.1]) by venkatar-opt-lnx.internal.synopsys.com (8.13.1/8.12.3) with ESMTP id m76HpVC1003888; Wed, 6 Aug 2008 10:51:31 -0700 Received: (from jbuck@localhost) by venkatar-opt-lnx.internal.synopsys.com (8.13.1/8.13.1/Submit) id m76HpPcI003887; Wed, 6 Aug 2008 10:51:25 -0700 Date: Wed, 06 Aug 2008 17:52:00 -0000 From: Joe Buck To: Paul Koning Cc: mark.kettenis@xs4all.nl, drow@false.org, gcc@sources.redhat.com, sposelenov@emcraft.com, gdb@sources.redhat.com Subject: Re: Problem reading corefiles on ARM Message-ID: <20080806175125.GM18206@synopsys.com> References: <4899C0FE.4010008@emcraft.com> <20080806152736.GA31492@caradoc.them.org> <200808061542.m76FgmUv017348@brahms.sibelius.xs4all.nl> <18585.51522.726379.18666@gargle.gargle.HOWL> <20080806170912.GL18206@synopsys.com> <18585.57711.850217.939413@gargle.gargle.HOWL> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18585.57711.850217.939413@gargle.gargle.HOWL> User-Agent: Mutt/1.4.1i Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00110.txt.bz2 I wrote: > Joe> There are several effects from "noreturn". We would want some > Joe> of these effects for "abort", but not others, to get debuggable > Joe> code without degrading compile-time warnings. On Wed, Aug 06, 2008 at 01:37:51PM -0400, Paul Koning wrote: > So the issue is that two unrelated features are currently combined in > a single attribute: > > 1. This function doesn't return, do the right thing with warnings in > the caller of this function. > > 2. Don't bother saving registers when calling this function because it > won't return so the registers aren't needed afterwards. > > The issue is that #2 doesn't apply to "abort" because the registers > ARE needed afterwards -- at debug time. But not necessarily all of them (depending on platform). That is, the caller-saved registers don't have to be saved because the function isn't returning, but there has to be enough of a stack frame so that a debugger can set a breakpoint on the abort and determine who the caller was. > One possibility is to have "noreturn" mean #1 only, and invent a new > flag for #2. The alternative is to have "noreturn" mean both (as > today) and invent a new flag to cancel #2. > > I'd suggest the former because that's the more likely case. It's hard > to think of examples where #2 is needed (or at least, where it is > important). Evidently there was a motivating application where #2 was an important optimization. Still, I think you're right that it would be better to do it only if the optimization is asked for (via a new flag).