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


On Wed, Oct 31, 2012 at 2:34 AM, Richard Biener
<richard.guenther@gmail.com> wrote:
> On Wed, Oct 31, 2012 at 12:57 AM, Xinliang David Li <davidxl@google.com> wrote:
>> It will make the location info for the newly synthesized stmt more
>> deterministic, I think.
>
> Maybe, but it will increase the jumpiness in the debugger without actually
> being accurate, no?  For example if the partially redundant expression is

Sometimes, it is necessary to have a jump in gdb, especially when
control flow changes. For the test case I gave, people may want to
know if the branch in line 10 is taken or not. Without this patch, the
gdb simply jump from line 10 to line 15 if the branch is not taken.
But with the patch, people get the correct control flow.

One more thing, for AutoFDO to work, we want to make sure debug info
is correct at control flow boundaries. That is why we would prefer
deterministic location info, instead of randomly inherit debug info
from previous BB.

Thanks,
Dehao

>
>   i + j;
>
> then when computed at the insertion point the values of i and j do not
> necessarily reflect the computed value!  Instead we may compute the
> result of i + j using completely different components / operation.
>
> Thus I think inserted expressions should not have any debug information
> at all because they do not correspond to a source line.
>
> Richard.
>
>> David
>>
>> On Tue, Oct 30, 2012 at 4:38 PM, Steven Bosscher <stevenb.gcc@gmail.com> wrote:
>>> On Wed, Oct 31, 2012 at 12:00 AM, Dehao Chen wrote:
>>>> This patch aims to improve debugging of optimized code. It ensures
>>>> that PRE inserted statements have the same source location as the
>>>> statement at the insertion point, instead of UNKNOWN_LOCATION.
>>>
>>> Wrong patch attached.
>>>
>>> However, is it really better to have the location of the insertion
>>> point than to have UNKNOWN_LOCATION? It's not where the value is
>>> computed in the source program...
>>>
>>> Ciao!
>>> Steven


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