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] Reset source location for instructions moved out of its original residing basic block


On Thu, Nov 1, 2012 at 1:52 AM, Eric Botcazou <ebotcazou@adacore.com> wrote:
>> This patch tries to fix this problem by resetting the source location
>> when moving instructions to another BB. This can greatly improve the
>> debuggability of optimized code. For the attached unittest. Without
>> the patch, the debugger will always jump into line 14 even when the
>> branch at line 13 is not taken. With the patch, the problem is fixed.
>
> But this breaks coverage info!  You cannot change the source location of

For optimized code, there are many optimizations that can break
coverage info. Code motion is one of them. This patch actually tries
to fix the broken coverage info, as illustrated by the unittest.

> instructions randomly like that; the rule should be that, once a location is
> set, it cannot be changed.  At most it can be cleared.

If we clear the debug info for instructions moved to other BB, is it acceptable?

Thanks,
Dehao

>
>> gcc/ChangeLog:
>> 2012-10-31  Dehao Chen  <dehao@google.com>
>>
>>         * emit-rtl.c (reorder_insns): Reset the source location for
>>         instructions moved out of its original residing basic block.
>
> No, that isn't acceptable.
>
> --
> Eric Botcazou


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