This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Update source location for PRE inserted stmt


Yeah, at least for the unittest I provided, the coverage info will be
wrong without the patch.

Thanks,
Dehao

On Thu, Nov 15, 2012 at 10:30 AM, Xinliang David Li <davidxl@google.com> wrote:
> I probably made too general statement in this topic. However for the
> PRE case, I believe the choice of not using UNKNOWN location is still
> better.
>
> thanks,
>
> David
>
> On Thu, Nov 15, 2012 at 9:23 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]