From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17469 invoked by alias); 20 Jan 2009 15:08:51 -0000 Received: (qmail 17397 invoked by uid 48); 20 Jan 2009 15:08:37 -0000 Date: Tue, 20 Jan 2009 15:08:00 -0000 Message-ID: <20090120150837.17395.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug middle-end/38587] [4.4 Regression] psim miscompiled #2 In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "hjl dot tools at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2009-01/txt/msg02195.txt.bz2 ------- Comment #25 from hjl dot tools at gmail dot com 2009-01-20 15:08 ------- (In reply to comment #24) > Subject: Re: [4.4 Regression] psim miscompiled #2 > > On Tue, 20 Jan 2009, hjl dot tools at gmail dot com wrote: > > > ------- Comment #23 from hjl dot tools at gmail dot com 2009-01-20 14:24 ------- > > (In reply to comment #22) > > > From tree-inline.c: > > > > > > case BUILT_IN_LONGJMP: > > > /* We can't inline functions that call __builtin_longjmp at > > > all. The non-local goto machinery really requires the > > > destination be in a different function. If we allow the > > > function calling __builtin_longjmp to be inlined into the > > > function calling __builtin_setjmp, Things will Go Awry. */ > > > > > > so IMHO we shouldn't inline foo (). See inline_forbidden_p_stmt. > > > > > > > foo () isn't inlined. We inline bar () which reuses stack slot used > > to restore registers after longjmp, which is called from foo (). > > Still I don't think this is an IRA bug. Either this code is sort-of > non-conforming or we need to throttle down inlining more. > Since -fno-ira works, I think it may be fixed in IRA if we can properly mark stack slots used to restore registers after setjmp. FWIW, bar () is marked as inline in sim. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38587