aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-06-09 00:10:35 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-06-08 22:10:35 +0000
commit44433db051a923a6e32baa8e448ec8cf5a88f5f8 (patch)
treef78b68891e4e416d52e41263d2ee4dd14d689473
parent13fdf2e2d578e629c456873c3a24bd0b2255c226 (diff)
downloadgcc-44433db051a923a6e32baa8e448ec8cf5a88f5f8.zip
gcc-44433db051a923a6e32baa8e448ec8cf5a88f5f8.tar.gz
gcc-44433db051a923a6e32baa8e448ec8cf5a88f5f8.tar.bz2
lto-streamer-out.c (lto_output_location): Stream reserved locations correctly.
* lto-streamer-out.c (lto_output_location): Stream reserved locations correctly. * lto-streamer-in.c (lto_output_location): Likewise. From-SVN: r224251
-rw-r--r--gcc/ChangeLog6
-rw-r--r--gcc/lto-streamer-in.c13
-rw-r--r--gcc/lto-streamer-out.c6
3 files changed, 17 insertions, 8 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 38fe369..f8e8e6d 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -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.
diff --git a/gcc/lto-streamer-in.c b/gcc/lto-streamer-in.c
index b4070de..7729b6c 100644
--- a/gcc/lto-streamer-in.c
+++ b/gcc/lto-streamer-in.c
@@ -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);
diff --git a/gcc/lto-streamer-out.c b/gcc/lto-streamer-out.c
index e14761b..9ee4312 100644
--- a/gcc/lto-streamer-out.c
+++ b/gcc/lto-streamer-out.c
@@ -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);