This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Identifying source file locations.
- To: Daniel Berlin <dan at cgsoftware dot com>
- Subject: Re: Identifying source file locations.
- From: kalmquist2 at hotmail dot com (Kenneth Almquist)
- Date: Sun, 10 Jun 2001 01:52:10 -0400 (EDT)
- Cc: gcc at gcc dot gnu dot org
Daniel Berlin wrote:
>> My interpretation is that "line" and "column"
>> identify the start of the statement.
>
> Not at all. They identify the line and column of an address.
> There is no assumption that a statement produces a single address.
> That's what is_stmt is for.
I wasn't clear here. What I meant was that
1) all the instructions for a given statement have the same
line and column values, and
2) the line and column values identify the position in the source
code where the statement begins.
> /* Flag that indicates the initial value of the is_stmt_start flag.
> In the present implementation, we do not mark any lines as
> the beginning of a source statement, because that information
> is not made available by the GCC front-end. */
I expect that you can do a pretty good job of setting this flag based
on location information. On machines which don't have a delay slot on
branch instructions, set the flag if no earlier instructions have the
same source code location. On machines with a branch delay slot, the
first instruction can be copied into branch delay slots, and the
is_stmt flag should be set for all these copies.
> If we just added 10 or 12 byte to each INSN (assuming you have < 65535
> files per compilation, you can do it with 10, but it's not really a
> savings, since it'll probably be realigned to 12 anyway), we could
> remove the line number notes altogether, and the code to copy/track
> them around, and the need for optimizations to track them around,
> unless they actually split insns.
Or add a pointer to a data structure containg the location information.
This data structure can also contain a pointer to the exception
handler region, so that exception handler region notes can also go
away.
Kenneth Almquist