This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Update source location for PRE inserted stmt
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Dehao Chen <dehao at google dot com>
- Cc: gcc-patches at gcc dot gnu dot org, Diego Novillo <dnovillo at google dot com>, Xinliang David Li <davidxl at google dot com>, Richard Biener <richard dot guenther at gmail dot com>, Steven Bosscher <stevenb dot gcc at gmail dot com>
- Date: Thu, 15 Nov 2012 18:23:04 +0100
- Subject: Re: [PATCH] Update source location for PRE inserted stmt
- References: <CAO2gOZWF4=vpgWhX+duS7B5z3dN_cvy7AjkefZ18hi2QsY6SPA@mail.gmail.com> <4091956.0a8HvaXkSL@polaris> <CAO2gOZUioCCDo8trE8Hn1G6M_o_nb5TJB7c0nYVxVLNs4oKE-Q@mail.gmail.com>
> The randomness here means that if we set UNKNOWN_LOCATION to insn, it
> can get source location anywhere. Even with some small code layout
> changes, the location for that insn could change. I would hope that in
> the future, we add an assertion when emitting instruction to enforce
> that INSN_LOCATION is never UNKNOWN_LOCATION. So when generate new
> instructions/stmts, if we can surely know where it is coming from, it
> is fine. Otherwise, instead of using UNKNOWN_LOCATION, we will set its
> location to where it is inserted. How does that sound?
Still the same problem: you cannot make that a general rule, since you don't
know the coverage status of the instruction just above the insertion point.
If a later optimization moves the new statements around, you may well end up
with wrong coverage info.
--
Eric Botcazou