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: [GOOGLE] Updates highest_location when updating next_discriminator_location


As discussed offline, this is actually due to missing parts of the
previous patch (some changes does not appear in the change log of
r199154). I've updated the patch to include those missing pieces.
Testing on going.

Dehao

On Tue, May 13, 2014 at 10:04 AM, Cary Coutant <ccoutant@google.com> wrote:
>> The problem is that linemap_location_from_macro_expansion_p will
>> always return true if locus has discriminator. And in linemap_lookup,
>> this will lead to call linemap_macro_map_lookup, in which there is an
>> assertion:
>>
>> linemap_assert (line >= LINEMAPS_MACRO_LOWEST_LOCATION (set));
>>
>> However, line is actually not a macro location.
>
> That sounds like we're leaking a discriminator location into the
> linemap code. Before you can call
> linemap_location_from_macro_expansion_p, you need to do this (as in
> expand_location_1):
>
>   /* If LOC describes a location with a discriminator, extract the
>      discriminator and map it to the real location.  */
>   if (min_discriminator_location != UNKNOWN_LOCATION
>       && loc >= min_discriminator_location
>       && loc < next_discriminator_location)
>     loc = map_discriminator_location (loc);
>
> -cary

Attachment: diff.txt
Description: Text document


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