lto-streamer-out.c (lto_output_location): Stream reserved locations correctly.
authorJan Hubicka <hubicka@ucw.cz>
Mon, 8 Jun 2015 22:10:35 +0000 (00:10 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Mon, 8 Jun 2015 22:10:35 +0000 (22:10 +0000)
* lto-streamer-out.c (lto_output_location): Stream
reserved locations correctly.
* lto-streamer-in.c (lto_output_location): Likewise.

From-SVN: r224251

gcc/ChangeLog
gcc/lto-streamer-in.c
gcc/lto-streamer-out.c

index 38fe3694f68e847540f99197822ee7aad5726077..f8e8e6de4ce1bafa94ff65af2c0d495389fcdf61 100644 (file)
@@ -1,3 +1,9 @@
+2015-06-08  Jan Hubicka  <hubicka@ucw.cz>
+
+       * lto-streamer-out.c (lto_output_location): Stream
+       reserved locations correctly.
+       * lto-streamer-in.c (lto_output_location): Likewise.
+
 2015-06-08  Andrew MacLeod  <amacleod@redhat.com>
 
        * coretypes.h: Include hash-table.h and hash-set.h for host files.
index b4070de288ac22ce09cf8d29d6bd1ba5ad531199..7729b6cf6978d5af58c92319829dd60d612c7d30 100644 (file)
@@ -272,12 +272,13 @@ lto_location_cache::input_location (location_t *loc, struct bitpack_d *bp,
 
   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);
index e14761bf64a46e2cbcf70c82d5ca36d14a839def..9ee43120080429a9db2b6cd4ff3acc4676c36dcc 100644 (file)
@@ -196,8 +196,10 @@ lto_output_location (struct output_block *ob, struct bitpack_d *bp,
   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);