From mboxrd@z Thu Jan 1 00:00:00 1970 From: dan@cgsoftware.com (Daniel Berlin+list.gcc) To: Bruno Haible Cc: gcc@gcc.gnu.org Subject: Re: tail call optimization vs. debugging Date: Fri, 24 Mar 2000 14:03:00 -0000 Message-id: References: <200003242038.VAA10143@halles.ilog.fr> X-SW-Source: 2000-03/msg00657.html Bruno Haible writes: > For each optimized tail call, in the debugger, there is a stack >frame missing. Given, AFAIK. > Example: > A () { B (); } > B () { C (); } > C () { D (); ... } > Here gdb will only display the stack frames of A and D. That is, the tail > call elimination makes debugging very hard. Maybe, i don't know yet. > > Many GNU programs are compiled with "-O2 -g" by default, which has been > up to now a good compromise between speed and ease of debugging. > Sure. > May I suggest: > > 1. that tail call elimination be disabled/enabled by a particular command > line option, Not my call. > > 2. that this command line option be "-fomit-frame-pointer", which is the > other optimization which makes debugging impossible. Since -O2 does > not imply "-fomit-frame-pointer", "-O2 -g" would continue to produce > reasonably debuggable code. Here's where i have a problem. -fomit-frame-pointer does not make code undebuggable. In the past it did have trouble, but it's had frame pointerless debugging for over a year now, i believe. When is the last time you tried to debug code with -fomit-frame-pointer on? --Dan > > Bruno