diff mbox series

[v3,3/3] PR preprocessor/83173: Enhance -fdump-internal-locations output

Message ID 20181101155607.11388-4-mgulick@mathworks.com
State New
Headers show
Series PR preprocessor/83173: C preprocessor generates incorrect linemarkers | expand

Commit Message

Mike Gulick Nov. 1, 2018, 3:56 p.m. UTC
2017-10-31  Mike Gulick  <mgulick@mathworks.com>

	PR preprocessor/83173
	* gcc/input.c (dump_location_info): Dump reason and
	included_from fields from line_map_ordinary struct.  Fix
	indentation when location > 5 digits.

	* libcpp/location-example.txt: Update example
	-fdump-internal-locations output.
---
 gcc/input.c                 |  49 +++++-
 libcpp/location-example.txt | 333 +++++++++++++++++++++---------------
 2 files changed, 241 insertions(+), 141 deletions(-)

Comments

David Malcolm Nov. 2, 2018, 9:04 p.m. UTC | #1
On Thu, 2018-11-01 at 11:56 -0400, Mike Gulick wrote:
> 2017-10-31  Mike Gulick  <mgulick@mathworks.com>
> 
> 	PR preprocessor/83173
> 	* gcc/input.c (dump_location_info): Dump reason and
> 	included_from fields from line_map_ordinary struct.  Fix
> 	indentation when location > 5 digits.
> 
> 	* libcpp/location-example.txt: Update example
> 	-fdump-internal-locations output.
> ---
>  gcc/input.c                 |  49 +++++-
>  libcpp/location-example.txt | 333 +++++++++++++++++++++-------------
> --
>  2 files changed, 241 insertions(+), 141 deletions(-)

Sorry about the belated response.  This is a nice enhancement; some
nits below.

> diff --git a/gcc/input.c b/gcc/input.c
> index a94a010f353..f938a37f20e 100644
> --- a/gcc/input.c
> +++ b/gcc/input.c
> @@ -1075,6 +1075,17 @@ dump_labelled_location_range (FILE *stream,
>    fprintf (stream, "\n");
>  }
>  
> +#define NUM_DIGITS(x) ((x) >= 1000000000 ? 10 : \
> +		       (x) >= 100000000 ? 9 : \
> +		       (x) >= 10000000 ? 8 : \
> +		       (x) >= 1000000 ? 7 : \
> +		       (x) >= 100000 ? 6 : \
> +		       (x) >= 10000 ? 5 : \
> +		       (x) >= 1000 ? 4 : \
> +		       (x) >= 100 ? 3 : \
> +		       (x) >= 10 ? 2 : \
> +		       1)

diagnostic-show-locus.c has a function "num_digits" (currently static)
and, fwiw, a unit test.  It would be good to share the implementation.

>  /* Write a visualization of the locations in the line_table to
> STREAM.  */
>  
>  void
> @@ -1104,6 +1115,35 @@ dump_location_info (FILE *stream)
>  	       map->m_column_and_range_bits - map->m_range_bits);
>        fprintf (stream, "  range bits: %i\n",
>  	       map->m_range_bits);
> +      const char * reason;
> +      switch (map->reason) {
> +      case LC_ENTER:
> +	reason = "LC_ENTER";
> +	break;
> +      case LC_LEAVE:
> +	reason = "LC_LEAVE";
> +	break;
> +      case LC_RENAME:
> +	reason = "LC_RENAME";
> +	break;
> +      case LC_RENAME_VERBATIM:
> +	reason = "LC_RENAME_VERBATIM";
> +	break;
> +      case LC_ENTER_MACRO:
> +	reason = "LC_RENAME_MACRO";
> +	break;
> +      default:
> +	reason = "Unknown";
> +      }
> +      fprintf (stream, "  reason: %d (%s)\n", map->reason, reason);
> +
> +      const line_map_ordinary *includer_map
> +	= linemap_included_from_linemap (line_table, map);
> +      fprintf (stream, "  included from map: %d\n",
> +	       includer_map ? int (includer_map - line_table-
> >info_ordinary.maps)
> +	       : -1);

I'm not a fan of "-1" here; it's a NULL pointer in the original data.
How about "n/a" for that case?


> +      fprintf (stream, "  included from location: %d\n",
> +	       linemap_included_from (map));

...or merging it with this line, for something like:

  included from location: 127 (in ordinary map 2)

vs:

  included from location: 0

[...snip...]

Other than that, this is OK for trunk, assuming your contributor
paperwork is in place.

Dave
Mike Gulick Nov. 12, 2018, 9:13 p.m. UTC | #2
On 11/2/18 5:04 PM, David Malcolm wrote:
> On Thu, 2018-11-01 at 11:56 -0400, Mike Gulick wrote:
>> 2017-10-31  Mike Gulick  <mgulick@mathworks.com>
>>
>> 	PR preprocessor/83173
>> 	* gcc/input.c (dump_location_info): Dump reason and
>> 	included_from fields from line_map_ordinary struct.  Fix
>> 	indentation when location > 5 digits.
>>
>> 	* libcpp/location-example.txt: Update example
>> 	-fdump-internal-locations output.
>> ---
>>  gcc/input.c                 |  49 +++++-
>>  libcpp/location-example.txt | 333 +++++++++++++++++++++-------------
>> --
>>  2 files changed, 241 insertions(+), 141 deletions(-)
> 
> Sorry about the belated response.  This is a nice enhancement; some
> nits below.
> 
>> diff --git a/gcc/input.c b/gcc/input.c
>> index a94a010f353..f938a37f20e 100644
>> --- a/gcc/input.c
>> +++ b/gcc/input.c
>> @@ -1075,6 +1075,17 @@ dump_labelled_location_range (FILE *stream,
>>    fprintf (stream, "\n");
>>  }
>>  
>> +#define NUM_DIGITS(x) ((x) >= 1000000000 ? 10 : \
>> +		       (x) >= 100000000 ? 9 : \
>> +		       (x) >= 10000000 ? 8 : \
>> +		       (x) >= 1000000 ? 7 : \
>> +		       (x) >= 100000 ? 6 : \
>> +		       (x) >= 10000 ? 5 : \
>> +		       (x) >= 1000 ? 4 : \
>> +		       (x) >= 100 ? 3 : \
>> +		       (x) >= 10 ? 2 : \
>> +		       1)
> 
> diagnostic-show-locus.c has a function "num_digits" (currently static)
> and, fwiw, a unit test.  It would be good to share the implementation.
> 

I initially tried to use this function by just adding "extern int
num_digits(int);" into diagnostic-core.h, but that failed to link, so it seems
like diagnostic-show-locus.c is not included in whatever library input.c gets
linked with (I forget which library it was trying to link).  Instead I moved
num_digits and its unit test to diagnostic.c, and added the extern definition to
diagnostic-core.h.  That builds and tests successfully.  Does that seem like a
reasonable way to do this?

>>  /* Write a visualization of the locations in the line_table to
>> STREAM.  */
>>  
>>  void
>> @@ -1104,6 +1115,35 @@ dump_location_info (FILE *stream)
>>  	       map->m_column_and_range_bits - map->m_range_bits);
>>        fprintf (stream, "  range bits: %i\n",
>>  	       map->m_range_bits);
>> +      const char * reason;
>> +      switch (map->reason) {
>> +      case LC_ENTER:
>> +	reason = "LC_ENTER";
>> +	break;
>> +      case LC_LEAVE:
>> +	reason = "LC_LEAVE";
>> +	break;
>> +      case LC_RENAME:
>> +	reason = "LC_RENAME";
>> +	break;
>> +      case LC_RENAME_VERBATIM:
>> +	reason = "LC_RENAME_VERBATIM";
>> +	break;
>> +      case LC_ENTER_MACRO:
>> +	reason = "LC_RENAME_MACRO";
>> +	break;
>> +      default:
>> +	reason = "Unknown";
>> +      }
>> +      fprintf (stream, "  reason: %d (%s)\n", map->reason, reason);
>> +
>> +      const line_map_ordinary *includer_map
>> +	= linemap_included_from_linemap (line_table, map);
>> +      fprintf (stream, "  included from map: %d\n",
>> +	       includer_map ? int (includer_map - line_table-
>>> info_ordinary.maps)
>> +	       : -1);
> 
> I'm not a fan of "-1" here; it's a NULL pointer in the original data.
> How about "n/a" for that case?
> 

That's a good suggestion.  Thanks.

>> +      fprintf (stream, "  included from location: %d\n",
>> +	       linemap_included_from (map));
> 
> ...or merging it with this line, for something like:
> 
>   included from location: 127 (in ordinary map 2)
> 
> vs:
> 
>   included from location: 0
> 
> [...snip...]
> 
> Other than that, this is OK for trunk, assuming your contributor
> paperwork is in place.
> 
> Dave
> 

What is the preferred way to re-send this patch?  Should I re-send the entire
patch series as v4, or just an updated version of this single patch?

Also, I'm waiting on FSF for assignment paperwork.  I've re-pinged them after
waiting a week.

Thanks for the feedback and help.

-Mike
David Malcolm Nov. 13, 2018, 12:56 a.m. UTC | #3
On Mon, 2018-11-12 at 21:13 +0000, Mike Gulick wrote:
> On 11/2/18 5:04 PM, David Malcolm wrote:
> > On Thu, 2018-11-01 at 11:56 -0400, Mike Gulick wrote:
> > > 2017-10-31  Mike Gulick  <mgulick@mathworks.com>
> > > 
> > > 	PR preprocessor/83173
> > > 	* gcc/input.c (dump_location_info): Dump reason and
> > > 	included_from fields from line_map_ordinary struct.  Fix
> > > 	indentation when location > 5 digits.
> > > 
> > > 	* libcpp/location-example.txt: Update example
> > > 	-fdump-internal-locations output.
> > > ---
> > >  gcc/input.c                 |  49 +++++-
> > >  libcpp/location-example.txt | 333 +++++++++++++++++++++---------
> > > ----
> > > --
> > >  2 files changed, 241 insertions(+), 141 deletions(-)
> > 
> > Sorry about the belated response.  This is a nice enhancement; some
> > nits below.
> > 
> > > diff --git a/gcc/input.c b/gcc/input.c
> > > index a94a010f353..f938a37f20e 100644
> > > --- a/gcc/input.c
> > > +++ b/gcc/input.c
> > > @@ -1075,6 +1075,17 @@ dump_labelled_location_range (FILE
> > > *stream,
> > >    fprintf (stream, "\n");
> > >  }
> > >  
> > > +#define NUM_DIGITS(x) ((x) >= 1000000000 ? 10 : \
> > > +		       (x) >= 100000000 ? 9 : \
> > > +		       (x) >= 10000000 ? 8 : \
> > > +		       (x) >= 1000000 ? 7 : \
> > > +		       (x) >= 100000 ? 6 : \
> > > +		       (x) >= 10000 ? 5 : \
> > > +		       (x) >= 1000 ? 4 : \
> > > +		       (x) >= 100 ? 3 : \
> > > +		       (x) >= 10 ? 2 : \
> > > +		       1)
> > 
> > diagnostic-show-locus.c has a function "num_digits" (currently
> > static)
> > and, fwiw, a unit test.  It would be good to share the
> > implementation.
> > 
> 
> I initially tried to use this function by just adding "extern int
> num_digits(int);" into diagnostic-core.h, but that failed to link, so
> it seems
> like diagnostic-show-locus.c is not included in whatever library
> input.c gets
> linked with (I forget which library it was trying to link). 

Both input.o and diagnostic-show-locus.o are in OBJS-libcommon, so I'm
not sure what went wrong.

> Instead I moved
> num_digits and its unit test to diagnostic.c, and added the extern
> definition to
> diagnostic-core.h.  That builds and tests successfully.  Does that
> seem like a
> reasonable way to do this?

Thanks.  That sounds good (maybe put the decl in diagnostic.h rather
than diagnostic-core.h; the latter is used in lots of places, whereas
the former is more about implementation details).

> > >  /* Write a visualization of the locations in the line_table to
> > > STREAM.  */
> > >  
> > >  void
> > > @@ -1104,6 +1115,35 @@ dump_location_info (FILE *stream)
> > >  	       map->m_column_and_range_bits - map-
> > > >m_range_bits);
> > >        fprintf (stream, "  range bits: %i\n",
> > >  	       map->m_range_bits);
> > > +      const char * reason;
> > > +      switch (map->reason) {
> > > +      case LC_ENTER:
> > > +	reason = "LC_ENTER";
> > > +	break;
> > > +      case LC_LEAVE:
> > > +	reason = "LC_LEAVE";
> > > +	break;
> > > +      case LC_RENAME:
> > > +	reason = "LC_RENAME";
> > > +	break;
> > > +      case LC_RENAME_VERBATIM:
> > > +	reason = "LC_RENAME_VERBATIM";
> > > +	break;
> > > +      case LC_ENTER_MACRO:
> > > +	reason = "LC_RENAME_MACRO";
> > > +	break;
> > > +      default:
> > > +	reason = "Unknown";
> > > +      }
> > > +      fprintf (stream, "  reason: %d (%s)\n", map->reason,
> > > reason);
> > > +
> > > +      const line_map_ordinary *includer_map
> > > +	= linemap_included_from_linemap (line_table, map);
> > > +      fprintf (stream, "  included from map: %d\n",
> > > +	       includer_map ? int (includer_map - line_table-
> > > > info_ordinary.maps)
> > > 
> > > +	       : -1);
> > 
> > I'm not a fan of "-1" here; it's a NULL pointer in the original
> > data.
> > How about "n/a" for that case?
> > 
> 
> That's a good suggestion.  Thanks.
> 
> > > +      fprintf (stream, "  included from location: %d\n",
> > > +	       linemap_included_from (map));
> > 
> > ...or merging it with this line, for something like:
> > 
> >   included from location: 127 (in ordinary map 2)
> > 
> > vs:
> > 
> >   included from location: 0
> > 
> > [...snip...]
> > 
> > Other than that, this is OK for trunk, assuming your contributor
> > paperwork is in place.
> > 
> > Dave
> > 
> 
> What is the preferred way to re-send this patch?  Should I re-send
> the entire
> patch series as v4, or just an updated version of this single patch?

The latter: just an updated version of the changed patch.  IIRC the
rest is all approved.

> 
> Also, I'm waiting on FSF for assignment paperwork.  I've re-pinged
> them after
> waiting a week.

Thanks.

> Thanks for the feedback and help.
> 
> -Mike
Mike Gulick Nov. 13, 2018, 7:40 p.m. UTC | #4
On 11/12/18 7:56 PM, David Malcolm wrote:
> On Mon, 2018-11-12 at 21:13 +0000, Mike Gulick wrote:
>> On 11/2/18 5:04 PM, David Malcolm wrote:
>>> On Thu, 2018-11-01 at 11:56 -0400, Mike Gulick wrote:
>>>> 2017-10-31  Mike Gulick  <mgulick@mathworks.com>
>>>>
>>>> 	PR preprocessor/83173
>>>> 	* gcc/input.c (dump_location_info): Dump reason and
>>>> 	included_from fields from line_map_ordinary struct.  Fix
>>>> 	indentation when location > 5 digits.
>>>>
>>>> 	* libcpp/location-example.txt: Update example
>>>> 	-fdump-internal-locations output.
>>>> ---
>>>>  gcc/input.c                 |  49 +++++-
>>>>  libcpp/location-example.txt | 333 +++++++++++++++++++++---------
>>>> ----
>>>> --
>>>>  2 files changed, 241 insertions(+), 141 deletions(-)
>>>
>>> Sorry about the belated response.  This is a nice enhancement; some
>>> nits below.
>>>
>>>> diff --git a/gcc/input.c b/gcc/input.c
>>>> index a94a010f353..f938a37f20e 100644
>>>> --- a/gcc/input.c
>>>> +++ b/gcc/input.c
>>>> @@ -1075,6 +1075,17 @@ dump_labelled_location_range (FILE
>>>> *stream,
>>>>    fprintf (stream, "\n");
>>>>  }
>>>>  
>>>> +#define NUM_DIGITS(x) ((x) >= 1000000000 ? 10 : \
>>>> +		       (x) >= 100000000 ? 9 : \
>>>> +		       (x) >= 10000000 ? 8 : \
>>>> +		       (x) >= 1000000 ? 7 : \
>>>> +		       (x) >= 100000 ? 6 : \
>>>> +		       (x) >= 10000 ? 5 : \
>>>> +		       (x) >= 1000 ? 4 : \
>>>> +		       (x) >= 100 ? 3 : \
>>>> +		       (x) >= 10 ? 2 : \
>>>> +		       1)
>>>
>>> diagnostic-show-locus.c has a function "num_digits" (currently
>>> static)
>>> and, fwiw, a unit test.  It would be good to share the
>>> implementation.
>>>
>>
>> I initially tried to use this function by just adding "extern int
>> num_digits(int);" into diagnostic-core.h, but that failed to link, so
>> it seems
>> like diagnostic-show-locus.c is not included in whatever library
>> input.c gets
>> linked with (I forget which library it was trying to link). 
> 
> Both input.o and diagnostic-show-locus.o are in OBJS-libcommon, so I'm
> not sure what went wrong.
> 

After looking at libcommon.a with nm, I realized that
diagnostic-show-locus.c wrapped everything inside an anonymous
namespace, so that was why the symbol wasn't visible.

>> Instead I moved
>> num_digits and its unit test to diagnostic.c, and added the extern
>> definition to
>> diagnostic-core.h.  That builds and tests successfully.  Does that
>> seem like a
>> reasonable way to do this?
> 
> Thanks.  That sounds good (maybe put the decl in diagnostic.h rather
> than diagnostic-core.h; the latter is used in lots of places, whereas
> the former is more about implementation details).
>

No problem.

>>>>  /* Write a visualization of the locations in the line_table to
>>>> STREAM.  */
>>>>  
>>>>  void
>>>> @@ -1104,6 +1115,35 @@ dump_location_info (FILE *stream)
>>>>  	       map->m_column_and_range_bits - map-
>>>>> m_range_bits);
>>>>        fprintf (stream, "  range bits: %i\n",
>>>>  	       map->m_range_bits);
>>>> +      const char * reason;
>>>> +      switch (map->reason) {
>>>> +      case LC_ENTER:
>>>> +	reason = "LC_ENTER";
>>>> +	break;
>>>> +      case LC_LEAVE:
>>>> +	reason = "LC_LEAVE";
>>>> +	break;
>>>> +      case LC_RENAME:
>>>> +	reason = "LC_RENAME";
>>>> +	break;
>>>> +      case LC_RENAME_VERBATIM:
>>>> +	reason = "LC_RENAME_VERBATIM";
>>>> +	break;
>>>> +      case LC_ENTER_MACRO:
>>>> +	reason = "LC_RENAME_MACRO";
>>>> +	break;
>>>> +      default:
>>>> +	reason = "Unknown";
>>>> +      }
>>>> +      fprintf (stream, "  reason: %d (%s)\n", map->reason,
>>>> reason);
>>>> +
>>>> +      const line_map_ordinary *includer_map
>>>> +	= linemap_included_from_linemap (line_table, map);
>>>> +      fprintf (stream, "  included from map: %d\n",
>>>> +	       includer_map ? int (includer_map - line_table-
>>>>> info_ordinary.maps)
>>>>
>>>> +	       : -1);
>>>
>>> I'm not a fan of "-1" here; it's a NULL pointer in the original
>>> data.
>>> How about "n/a" for that case?
>>>
>>
>> That's a good suggestion.  Thanks.
>>
>>>> +      fprintf (stream, "  included from location: %d\n",
>>>> +	       linemap_included_from (map));
>>>
>>> ...or merging it with this line, for something like:
>>>
>>>   included from location: 127 (in ordinary map 2)
>>>
>>> vs:
>>>
>>>   included from location: 0
>>>
>>> [...snip...]
>>>
>>> Other than that, this is OK for trunk, assuming your contributor
>>> paperwork is in place.
>>>
>>> Dave
>>>
>>
>> What is the preferred way to re-send this patch?  Should I re-send
>> the entire
>> patch series as v4, or just an updated version of this single patch?
> 
> The latter: just an updated version of the changed patch.  IIRC the
> rest is all approved.
>

Thanks, I'll reply with the updated patch.

>>
>> Also, I'm waiting on FSF for assignment paperwork.  I've re-pinged
>> them after
>> waiting a week.
> 
> Thanks.
> 
>> Thanks for the feedback and help.
>>
>> -Mike
>
diff mbox series

Patch

diff --git a/gcc/input.c b/gcc/input.c
index a94a010f353..f938a37f20e 100644
--- a/gcc/input.c
+++ b/gcc/input.c
@@ -1075,6 +1075,17 @@  dump_labelled_location_range (FILE *stream,
   fprintf (stream, "\n");
 }
 
+#define NUM_DIGITS(x) ((x) >= 1000000000 ? 10 : \
+		       (x) >= 100000000 ? 9 : \
+		       (x) >= 10000000 ? 8 : \
+		       (x) >= 1000000 ? 7 : \
+		       (x) >= 100000 ? 6 : \
+		       (x) >= 10000 ? 5 : \
+		       (x) >= 1000 ? 4 : \
+		       (x) >= 100 ? 3 : \
+		       (x) >= 10 ? 2 : \
+		       1)
+
 /* Write a visualization of the locations in the line_table to STREAM.  */
 
 void
@@ -1104,6 +1115,35 @@  dump_location_info (FILE *stream)
 	       map->m_column_and_range_bits - map->m_range_bits);
       fprintf (stream, "  range bits: %i\n",
 	       map->m_range_bits);
+      const char * reason;
+      switch (map->reason) {
+      case LC_ENTER:
+	reason = "LC_ENTER";
+	break;
+      case LC_LEAVE:
+	reason = "LC_LEAVE";
+	break;
+      case LC_RENAME:
+	reason = "LC_RENAME";
+	break;
+      case LC_RENAME_VERBATIM:
+	reason = "LC_RENAME_VERBATIM";
+	break;
+      case LC_ENTER_MACRO:
+	reason = "LC_RENAME_MACRO";
+	break;
+      default:
+	reason = "Unknown";
+      }
+      fprintf (stream, "  reason: %d (%s)\n", map->reason, reason);
+
+      const line_map_ordinary *includer_map
+	= linemap_included_from_linemap (line_table, map);
+      fprintf (stream, "  included from map: %d\n",
+	       includer_map ? int (includer_map - line_table->info_ordinary.maps)
+	       : -1);
+      fprintf (stream, "  included from location: %d\n",
+	       linemap_included_from (map));
 
       /* Render the span of source lines that this "map" covers.  */
       for (source_location loc = MAP_START_LOCATION (map);
@@ -1137,7 +1177,14 @@  dump_location_info (FILE *stream)
 	      if (max_col > line_text.length ())
 		max_col = line_text.length () + 1;
 
-	      int indent = 14 + strlen (exploc.file);
+	      int len_lnum = NUM_DIGITS (exploc.line);
+	      if (len_lnum < 3)
+		len_lnum = 3;
+	      int len_loc = NUM_DIGITS (loc);
+	      if (len_loc < 5)
+		len_loc = 5;
+
+	      int indent = 6 + strlen (exploc.file) + len_lnum + len_loc;
 
 	      /* Thousands.  */
 	      if (end_location > 999)
diff --git a/libcpp/location-example.txt b/libcpp/location-example.txt
index 14b5c2e284a..dc448b0493e 100644
--- a/libcpp/location-example.txt
+++ b/libcpp/location-example.txt
@@ -33,8 +33,12 @@  ORDINARY MAP: 0
   source_location interval: 32 <= loc < 64
   file: test.c
   starting at line: 1
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
+  reason: 0 (LC_ENTER)
+  included from map: -1
+  included from location: 0
 test.c:  1|loc:   32|#include "test.h"
                     |69269258258148147
                     |46802468024680246
@@ -43,186 +47,235 @@  ORDINARY MAP: 1
   source_location interval: 64 <= loc < 96
   file: <built-in>
   starting at line: 0
+  column and range bits: 0
   column bits: 0
   range bits: 0
+  reason: 2 (LC_RENAME)
+  included from map: -1
+  included from location: 0
 
 ORDINARY MAP: 2
   source_location interval: 96 <= loc < 128
   file: <command-line>
   starting at line: 0
+  column and range bits: 0
   column bits: 0
   range bits: 0
+  reason: 2 (LC_RENAME)
+  included from map: -1
+  included from location: 0
 
 ORDINARY MAP: 3
-  source_location interval: 128 <= loc < 160128
+  source_location interval: 128 <= loc < 250240
   file: /usr/include/stdc-predef.h
   starting at line: 1
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
+  reason: 0 (LC_ENTER)
+  included from map: 2
+  included from location: 127
 (contents of /usr/include/stdc-predef.h snipped for brevity)
 
 ORDINARY MAP: 4
-  source_location interval: 160128 <= loc < 160160
+  source_location interval: 250240 <= loc < 250272
   file: <command-line>
   starting at line: 32
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
+  reason: 1 (LC_LEAVE)
+  included from map: -1
+  included from location: 0
 
 ORDINARY MAP: 5
-  source_location interval: 160160 <= loc < 164256
+  source_location interval: 250272 <= loc < 254368
   file: test.c
   starting at line: 1
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
-test.c:  1|loc:160160|#include "test.h"
-                    |00000000000000000
-                    |12223334445556667
-                    |92582581481470470
-                    |24680246802468024
+  reason: 2 (LC_RENAME)
+  included from map: -1
+  included from location: 0
+test.c:  1|loc:250272|#include "test.h"
+                     |00000000000000000
+                     |33344445556667778
+                     |03603692692582581
+                     |46802468024680246
 
 ORDINARY MAP: 6
-  source_location interval: 164256 <= loc < 173280
+  source_location interval: 254368 <= loc < 266720
   file: test.h
   starting at line: 1
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
-test.h:  1|loc:164256|extern int foo ();
-                    |444444444444444444
-                    |233344455566677788
-                    |825814814704703603
-                    |802468024680246802
-test.h:  2|loc:168352|
-                    |
-                    |
-                    |
-                    |
-test.h:  3|loc:172448|#define PLUS(A, B) A + B
-                    |222222222222222223333333
-                    |455566677788889990001112
-                    |814704703603692692582581
-                    |024680246802468024680246
+  reason: 0 (LC_ENTER)
+  included from map: 5
+  included from location: 250272
+test.h:  1|loc:254368|extern int foo ();
+                     |444444444444444444
+                     |444455566677788899
+                     |036926925825814814
+                     |024680246802468024
+test.h:  2|loc:258464|
+                     |
+                     |
+                     |
+                     |
+test.h:  3|loc:262560|#define PLUS(A, B) A + B
+                     |222222222222233333333333
+                     |566677788899900011122223
+                     |925825814814704703603692
+                     |246802468024680246802468
+test.h:  4|loc:266656|
+                     |
+                     |
+                     |
+                     |
 
 ORDINARY MAP: 7
-  source_location interval: 173280 <= loc < 202016
+  source_location interval: 266720 <= loc < 299520
   file: test.c
   starting at line: 2
-  column bits: 12
+  column and range bits: 12
+  column bits: 7
   range bits: 5
-test.c:  2|loc:173280|
-                    |
-                    |
-                    |
-                    |
-test.c:  3|loc:177376|int
-                    |777
-                    |444
-                    |047
-                    |802
-test.c:  4|loc:181472|main (int argc, char **argv)
-                    |1111111111111111222222222222
-                    |5556666777888999000111222333
-                    |0360369269258258148147047036
-                    |4680246802468024680246802468
-test.c:  5|loc:185568|{
-                    |5
-                    |6
-                    |0
-                    |0
-test.c:  6|loc:189664|  int a = PLUS (1,2);
-                    |999999999900000000000
-                    |677788899900011122233
-                    |926925825814814704703
-                    |680246802468024680246
-test.c:  7|loc:193760|  int b = PLUS (3,4);
-                    |333333344444444444444
-                    |788899900011122233344
-                    |925825814814704703603
-                    |246802468024680246802
-test.c:  8|loc:197856|  return 0;
-                    |77778888888
-                    |89990001112
-                    |82581481470
-                    |80246802468
-test.c:  9|loc:201952|}
-                    |1
-                    |9
-                    |8
-                    |4
+  reason: 1 (LC_LEAVE)
+  included from map: -1
+  included from location: 0
+test.c:  2|loc:266720|
+                     |
+                     |
+                     |
+                     |
+test.c:  3|loc:270816|int
+                     |000
+                     |889
+                     |481
+                     |802
+test.c:  4|loc:274912|main (int argc, char **argv)
+                     |4455555555555555555555555555
+                     |9900011122223334445556667778
+                     |4704703603692692582581481470
+                     |4680246802468024680246802468
+test.c:  5|loc:279008|{
+                     |9
+                     |0
+                     |4
+                     |0
+test.c:  6|loc:283104|  int a = PLUS (1,2);
+                     |333333333333333333333
+                     |112222333444555666777
+                     |360369269258258148147
+                     |680246802468024680246
+test.c:  7|loc:287200|  int b = PLUS (3,4);
+                     |777777777777777777777
+                     |222333444555666777888
+                     |369269258258148147047
+                     |246802468024680246802
+test.c:  8|loc:291296|  return 0;
+                     |11111111111
+                     |33344455566
+                     |26925825814
+                     |80246802468
+test.c:  9|loc:295392|}
+                     |5
+                     |4
+                     |2
+                     |4
+test.c: 10|loc:299488|
+                     |
+                     |
+                     |
+                     |
 
 UNALLOCATED LOCATIONS
-  source_location interval: 202016 <= loc < 2147483633
+  source_location interval: 299520 <= loc < 2147483632
 
-MACRO 1: PLUS (7 tokens)
-  source_location interval: 2147483633 <= loc < 2147483640
-test.c:7:11: note: expansion point is location 194115
-   int b = PLUS (3,4);
-           ^~~~
+MACRO 3: PLUS (7 tokens)
+  source_location interval: 2147483632 <= loc < 2147483639
+test.c:7:11: note: expansion point is location 287555
+    7 |   int b = PLUS (3,4);
+      |           ^~~~
+  map->start_location: 2147483632
+  macro_locations:
+    0: 287744, 263200
+test.c:7:17: note: token 0 has x-location == 287744
+    7 |   int b = PLUS (3,4);
+      |                 ^
+test.c:7:17: note: token 0 has y-location == 263200
+    1: 263264, 263264
+In file included from test.c:1:
+test.h:3:22: note: token 1 has x-location == y-location == 263264
+    3 | #define PLUS(A, B) A + B
+      |                      ^
+    2: 287808, 263328
+test.c:7:19: note: token 2 has x-location == 287808
+    7 |   int b = PLUS (3,4);
+      |                   ^
+test.c:7:19: note: token 2 has y-location == 263328
+    3: 0, 0
+cc1: note: token 3 has x-location == y-location == 0
+    4: 0, 0
+cc1: note: token 4 has x-location == y-location == 0
+    5: 0, 0
+cc1: note: token 5 has x-location == y-location == 0
+    6: 0, 0
+cc1: note: token 6 has x-location == y-location == 0
+
+MACRO 2: PLUS (7 tokens)
+  source_location interval: 2147483639 <= loc < 2147483646
+test.c:6:11: note: expansion point is location 283459
+    6 |   int a = PLUS (1,2);
+      |           ^~~~
+  map->start_location: 2147483639
+  macro_locations:
+    0: 283648, 263200
+test.c:6:17: note: token 0 has x-location == 283648
+    6 |   int a = PLUS (1,2);
+      |                 ^
+test.c:6:17: note: token 0 has y-location == 263200
+    1: 263264, 263264
+In file included from test.c:1:
+test.h:3:22: note: token 1 has x-location == y-location == 263264
+    3 | #define PLUS(A, B) A + B
+      |                      ^
+    2: 283712, 263328
+test.c:6:19: note: token 2 has x-location == 283712
+    6 |   int a = PLUS (1,2);
+      |                   ^
+test.c:6:19: note: token 2 has y-location == 263328
+    3: 0, 0
+cc1: note: token 3 has x-location == y-location == 0
+    4: 0, 0
+cc1: note: token 4 has x-location == y-location == 0
+    5: 0, 0
+cc1: note: token 5 has x-location == y-location == 0
+    6: 0, 0
+cc1: note: token 6 has x-location == y-location == 0
 
-  map->start_location: 2147483633
+MACRO 1: __GCC_IEC_559_COMPLEX (1 tokens)
+  source_location interval: 2147483646 <= loc < 2147483647
+In file included from <command-line>:31:
+/usr/include/stdc-predef.h:45:6: note: expansion point is location 180564
+   45 | # if __GCC_IEC_559_COMPLEX > 0
+      |      ^~~~~~~~~~~~~~~~~~~~~
+  map->start_location: 2147483646
   macro_locations:
-    0: 194304, 173088
-test.c:7:17: note: token 0 has x-location == 194304
-   int b = PLUS (3,4);
-                 ^
-
-test.c:7:17: note: token 0 has y-location == 173088
-    1: 173152, 173152
-In file included from test.c:1:0:
-test.h:3:22: note: token 1 has x-location == y-location == 173152
- #define PLUS(A, B) A + B
-                      ^
-
-    2: 194368, 173216
-test.c:7:19: note: token 2 has x-location == 194368
-   int b = PLUS (3,4);
-                   ^
-
-test.c:7:19: note: token 2 has y-location == 173216
-    3: 0, 2947526575
-cc1: note: token 3 has x-location == 0
-cc1: note: token 3 has y-location == 2947526575
-    4: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042942
-    5: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042942
-    6: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042942
-
-MACRO 0: PLUS (7 tokens)
-  source_location interval: 2147483640 <= loc < 2147483647
-test.c:6:11: note: expansion point is location 190019
-   int a = PLUS (1,2);
-           ^~~~
-
-  map->start_location: 2147483640
+    0: 1, 1
+<built-in>: note: token 0 has x-location == y-location == 1
+
+MACRO 0: __GCC_IEC_559 (1 tokens)
+  source_location interval: 2147483647 <= loc < 2147483648
+/usr/include/stdc-predef.h:37:6: note: expansion point is location 147788
+   37 | # if __GCC_IEC_559 > 0
+      |      ^~~~~~~~~~~~~
+  map->start_location: 2147483647
   macro_locations:
-    0: 190208, 173088
-test.c:6:17: note: token 0 has x-location == 190208
-   int a = PLUS (1,2);
-                 ^
-
-test.c:6:17: note: token 0 has y-location == 173088
-    1: 173152, 173152
-In file included from test.c:1:0:
-test.h:3:22: note: token 1 has x-location == y-location == 173152
- #define PLUS(A, B) A + B
-                      ^
-
-    2: 190272, 173216
-test.c:6:19: note: token 2 has x-location == 190272
-   int a = PLUS (1,2);
-                   ^
-
-test.c:6:19: note: token 2 has y-location == 173216
-    3: 0, 2947526575
-cc1: note: token 3 has x-location == 0
-cc1: note: token 3 has y-location == 2947526575
-    4: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042935
-    5: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042935
-    6: 2947526575, 2947526575
-x-location == y-location == 2947526575 encodes token # 800042935
+    0: 1, 1
+<built-in>: note: token 0 has x-location == y-location == 1
 
 MAX_SOURCE_LOCATION
   source_location interval: 2147483647 <= loc < 2147483648