public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: dan@cgsoftware.com (Daniel Berlin+list.gcc)
To: Bruno Haible <haible@ilog.fr>
Cc: gcc@gcc.gnu.org
Subject: Re: tail call optimization vs. debugging
Date: Fri, 24 Mar 2000 14:03:00 -0000	[thread overview]
Message-ID: <r9d0xby9.fsf@dan.resnet.rochester.edu> (raw)
In-Reply-To: <200003242038.VAA10143@halles.ilog.fr>

Bruno Haible <haible@ilog.fr> 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

  reply	other threads:[~2000-03-24 14:03 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-03-24 12:39 Bruno Haible
2000-03-24 14:03 ` Daniel Berlin+list.gcc [this message]
2000-03-24 14:24 ` Richard Henderson
2000-03-25  9:17 Geert Bosch
2000-03-25 11:35 ` Richard Henderson
2000-03-25 12:54 ` Martin v. Loewis
2000-03-25 13:08 Geert Bosch
2000-03-25 14:07 ` Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=r9d0xby9.fsf@dan.resnet.rochester.edu \
    --to=dan@cgsoftware.com \
    --cc=gcc@gcc.gnu.org \
    --cc=haible@ilog.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).