> 
> Yeah, I think streaming all locations up to RESERVED_LOCATION_COUNT
> literally is more robust.  Thus do
> 
>   bp_pack_int_in_range (bp, 0, RESERVED_LOCATION_COUNT,
>                       loc < RESERVED_LOCATION_COUNT ? loc : 
> RESERVED_LOCATION_COUNT);
>   if (loc < RESERVED_LOCATION_COUNT)
>     return;

Yep, I did that in meantime (did not notice we have RESERVED_LOCATION_COUNT)
This is what I commited.

2015-06-08  Jan Hubicka  <hubi...@ucw.cz>

        * lto-streamer-out.c (lto_output_location): Stream
        reserved locations correctly.
        * lto-streamer-in.c (lto_output_location): Likewise.
Index: lto-streamer-out.c
===================================================================
--- lto-streamer-out.c  (revision 224248)
+++ lto-streamer-out.c  (working copy)
@@ -202,8 +202,10 @@
   expanded_location xloc;
 
   loc = LOCATION_LOCUS (loc);
-  bp_pack_value (bp, loc == UNKNOWN_LOCATION, 1);
-  if (loc == UNKNOWN_LOCATION)
+  bp_pack_int_in_range (bp, 0, RESERVED_LOCATION_COUNT,
+                       loc < RESERVED_LOCATION_COUNT
+                       ? loc : RESERVED_LOCATION_COUNT);
+  if (loc < RESERVED_LOCATION_COUNT)
     return;
 
   xloc = expand_location (loc);
Index: lto-streamer-in.c
===================================================================
--- lto-streamer-in.c   (revision 224248)
+++ lto-streamer-in.c   (working copy)
@@ -278,13 +278,14 @@
 
   gcc_assert (current_cache == this);
 
-  if (bp_unpack_value (bp, 1))
-    {
-      *loc = UNKNOWN_LOCATION;
-      return;
-    }
-  *loc = BUILTINS_LOCATION + 1;
+  *loc = bp_unpack_int_in_range (bp, "location", 0, RESERVED_LOCATION_COUNT);
 
+  if (*loc < RESERVED_LOCATION_COUNT)
+    return;
+
+  /* Keep value RESERVED_LOCATION_COUNT in *loc as linemap lookups will
+     ICE on it.  */
+
   file_change = bp_unpack_value (bp, 1);
   line_change = bp_unpack_value (bp, 1);
   column_change = bp_unpack_value (bp, 1);

Reply via email to