public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Carlo Wood <carlo@alinoe.com>
To: gcc@gcc.gnu.org
Cc: wilson@specifixinc.com, jason@redhat.com, rth@redhat.com
Subject: RFA: Adding a location_t (or pointer) to tree_exp for 3.4 only.
Date: Sat, 27 Sep 2003 16:38:00 -0000	[thread overview]
Message-ID: <20030927124920.GA16447@alinoe.com> (raw)
In-Reply-To: <20030922001710.GA24248@alinoe.com>

I worked out several ways to achieve said goal of fixing the
debug info of calls and inlining,
(see http://gcc.gnu.org/ml/gcc/2003-09/msg00942.html)
but in all cases there needs to be a location_t assigned to
every CALL_EXPR.

The most robust and simplist solution is to add a
location_t to tree_exp.  When I mentioned on IRC that
I had solved it this way, there was objection about
memory usage.  But tree-ssa (3.5) even adds a
location_t to tree_common!  Then why not do the same
for 3.4 already so I can solve the problem at hand?

A suggestion was to use expr wfl, but that is impractical:
there are too many places where an expressions type is directly
compared with CALL_EXPR (if (TREE_CODE (call) != CALL_EXPR)) -
all of those places would have to be changed to also check for
a EXPR_WITH_FILE_LOCATION that wraps a CALL_EXPR and then
unwrap the call expr in order to subsequentially be able to
process it.  I heared that this is the way that tree-ssa has
attempted to add locations at first (using a macro STRIP_WFL),
but also then was decided that it was undoable.

Imho, the conclusion is, looking at how this will be done
more generally in 3.5, that we should simply solve this for
3.4 in the same way (memory consumption wise) and
- adding an addition pointer or integer to tree_exp, until the
merge with tree-ssa 3.5.  This should be acceptable.

If people think that that uses too much memory nevertheless,
then please explain how else it is possible to add a location_t
to a CALL_EXPR.  Or just tell me what WILL be approved in terms
of memory usage. 
- Add a complete tree_common + location_t to every
CALL_EXPR?  Then I could add another operand to call expressions.
- Or only a single location_t per CALL_EXPR (the very minimum of
memory usage).  That is possible but then I will have to make
some changes to how the ggc_* works now (I'd dynamically add a
location_t *behind* the operand[]).

On Mon, Sep 22, 2003 at 02:17:10AM +0200, Carlo Wood wrote:
> Proposal for new behaviour
> --------------------------
> 
> My proposal for a new behaviour is that the above assembly code
> would contain the following line numbers:
> 
> _Z1fv:
> .LFB4:
>         .file 1 "troep.c"
>         .loc 1 20 0			// Prologue of f() at line 20
>         pushl   %ebp
> .LCFI0:
>         movl    %esp, %ebp
> .LCFI1:
>         subl    $56, %esp
> .LCFI2:
> .LBB2:
> .LBB3:
>         .loc 1 21 0			// Line 21
>         call    _Z1hv			// Call that is actually done at line 21
>         movl    %eax, -12(%ebp)
> 	.loc 1 12 0			// Line 12
>         call    _Z1hv			// Call that is actually done at line 12
>         movl    %eax, -16(%ebp)
> .LBB4:
>         .loc 1 6 0			// Line 6 for inlined i()
>         movl    $12345, -24(%ebp)	// Assignment to v.
> 	.loc 1 13			// Line 13
>         call    _Z1hv			// Call that is actually done at line 13
[...]

-- 
Carlo Wood <carlo@alinoe.com>

  parent reply	other threads:[~2003-09-27 12:49 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-09-22  2:31 RFC: debug line info & inlining; patch proposal and request for comments Carlo Wood
2003-09-23  5:33 ` Jim Wilson
2003-09-27 16:38 ` Carlo Wood [this message]
2003-10-06 12:58   ` RFA: Adding a location_t (or pointer) to tree_exp for 3.4 only Hans-Peter Nilsson
2003-10-06 17:41   ` Richard Henderson
2003-10-06 17:51     ` Daniel Jacobowitz
2003-10-06 18:03       ` Daniel Berlin
2003-10-06 19:20         ` Carlo Wood
2003-10-06 19:08     ` Carlo Wood
2003-10-06 20:11       ` Richard Henderson
2003-10-06 20:14         ` Daniel Jacobowitz
2003-10-06 20:20           ` Richard Henderson
2003-10-06 20:24             ` Daniel Jacobowitz
2003-10-06 21:54               ` Richard Henderson
2003-10-06 21:53             ` Carlo Wood
2003-10-06 21:55               ` Richard Henderson
2003-10-06 22:30                 ` Carlo Wood
2003-10-06 23:17                   ` Richard Henderson
2003-10-06 23:49                     ` Carlo Wood
2003-10-07  0:07                       ` Richard Henderson
2003-10-07  0:43                         ` Carlo Wood
2003-10-07  0:46                           ` Richard Henderson
2003-10-07  2:40                             ` Carlo Wood
2003-10-07 18:32                             ` Carlo Wood
2003-10-07 19:08                               ` Carlo Wood
2003-10-07 19:46                               ` Richard Henderson
2003-10-07 21:12                                 ` Carlo Wood
2003-10-07 23:43                                   ` Carlo Wood
2003-10-07 19:41                 ` Carlo Wood
2003-10-12  4:32             ` law
2003-10-12 12:02               ` Daniel Berlin

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=20030927124920.GA16447@alinoe.com \
    --to=carlo@alinoe.com \
    --cc=gcc@gcc.gnu.org \
    --cc=jason@redhat.com \
    --cc=rth@redhat.com \
    --cc=wilson@specifixinc.com \
    /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).