From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14387 invoked by alias); 13 Dec 2004 15:43:28 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 13399 invoked from network); 13 Dec 2004 15:42:43 -0000 Received: from unknown (HELO cam-admin0.cambridge.arm.com) (193.131.176.58) by sourceware.org with SMTP; 13 Dec 2004 15:42:43 -0000 Received: from pc960.cambridge.arm.com (pc960.cambridge.arm.com [10.1.205.4]) by cam-admin0.cambridge.arm.com (8.12.10/8.12.10) with ESMTP id iBDFfcmb005440; Mon, 13 Dec 2004 15:41:38 GMT Received: from pc960.cambridge.arm.com (localhost.localdomain [127.0.0.1]) by pc960.cambridge.arm.com (8.12.8/8.12.8) with ESMTP id iBDFgWrg006617; Mon, 13 Dec 2004 15:42:32 GMT Received: (from rearnsha@localhost) by pc960.cambridge.arm.com (8.12.8/8.12.8/Submit) id iBDFgWMc006589; Mon, 13 Dec 2004 15:42:32 GMT X-Authentication-Warning: pc960.cambridge.arm.com: rearnsha set sender to rearnsha@gcc.gnu.org using -f Subject: Re: [Bug target/18929] Profiling optimized code causes segfaults on ARM due to missing frames From: Richard Earnshaw To: gcc-bugzilla@gcc.gnu.org Cc: gcc-bugs@gcc.gnu.org In-Reply-To: <20041213152816.29942.qmail@sourceware.org> References: <20041210181625.18929.opensource@artnaseef.com> <20041213152816.29942.qmail@sourceware.org> Content-Type: text/plain Content-Transfer-Encoding: 7bit Organization: GNU Message-Id: <1102952551.27716.24.camel@pc960.cambridge.arm.com> Mime-Version: 1.0 Date: Mon, 13 Dec 2004 15:46:00 -0000 X-SW-Source: 2004-12/txt/msg01803.txt.bz2 List-Id: On Mon, 2004-12-13 at 15:28, opensource at artnaseef dot com wrote: > ------- Additional Comments From opensource at artnaseef dot com 2004-12-13 15:28 ------- > Subject: Re: Profiling optimized code causes segfaults on > ARM due to missing frames > > Two things > > 1. Why do you not think the patch is correct? It works great for > me. Without > that information, I can only respond with "I think you are wrong," > and that > is not productive. > Because I don't think profiling should need the a frame pointer to work. If it does, then my feeling is that it's the profiling code that's broken, not the compiler. The layout of a stack frame is private to the function that built it, and any code outside of that function that tries to probe it is simply broken. > 2. The comment in the patch you show is that the Profiler clobbers the > Link > Register. That is NOT this problem. > Well, that patch was never applied to the 3.3 branch. The bug it refers to was reported against 3.0, so there's a strong likelihood that it will be needed in 3.3 as well. > In this problem, the profiler causes a segmentation fault when it reads > the wrong > return address off the stack and uses it as an invalid function > address. It does > not use the link register value. > > To reproduce the problem: > > - Build an arm-linux toolchain > > - Compile a program with optimization and profiling (try -O2 and -pg). > > - Make sure the program includes a function for which the optimizer > drops its frame pointer (this can easily be verified by looking at > the assembly output of the compiler). > > - Run the program. > > If a trace is needed, I will be able to produce one within a few days > and provide an example. Note that this problem was quite easy for me > to reproduce, so I would expect reproducing it to be simple enough for > others. I'm not in the business of trying to second guess how you encountered a problem. If you want us to investigate a bug then you need to send us precise instructions (including source code) so that we can reproduce it.