From: Bruno Haible <haible@ilog.fr>
To: gcc@gcc.gnu.org
Subject: tail call optimization vs. debugging
Date: Fri, 24 Mar 2000 12:39:00 -0000 [thread overview]
Message-ID: <200003242038.VAA10143@halles.ilog.fr> (raw)
For each optimized tail call, in the debugger, there is a stack frame missing.
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.
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.
May I suggest:
1. that tail call elimination be disabled/enabled by a particular command
line option,
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.
Bruno
next reply other threads:[~2000-03-24 12:39 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-03-24 12:39 Bruno Haible [this message]
2000-03-24 14:03 ` Daniel Berlin+list.gcc
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=200003242038.VAA10143@halles.ilog.fr \
--to=haible@ilog.fr \
--cc=gcc@gcc.gnu.org \
/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).