aboutsummaryrefslogtreecommitdiff
path: root/gcc/gcov-io.c
diff options
context:
space:
mode:
authorAndi Kleen <ak@linux.intel.com>2016-05-30 18:13:12 +0000
committerAndi Kleen <ak@gcc.gnu.org>2016-05-30 18:13:12 +0000
commit1bba63a77e3ed0a3420eaa905f753614d5ec99d5 (patch)
tree1985bc8a06c27e925e000ac5e9c9b1bc6053499a /gcc/gcov-io.c
parent53803093d096611166267de1390d0318592944e2 (diff)
downloadgcc-1bba63a77e3ed0a3420eaa905f753614d5ec99d5.zip
gcc-1bba63a77e3ed0a3420eaa905f753614d5ec99d5.tar.gz
gcc-1bba63a77e3ed0a3420eaa905f753614d5ec99d5.tar.bz2
Don't cause ICEs when auto profile file is not found with checking
Currently, on a checking enabled compiler when -fauto-profile does not find the profile feedback file it errors out with assertation failures. Add proper errors for this case. gcc/: 2016-05-30 Andi Kleen <ak@linux.intel.com> * auto-profile.c (read_profile): Replace asserts with errors when file does not exist. * gcov-io.c (gcov_read_words): Dito. From-SVN: r236894
Diffstat (limited to 'gcc/gcov-io.c')
-rw-r--r--gcc/gcov-io.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gcc/gcov-io.c b/gcc/gcov-io.c
index 17fcae0..95ead22 100644
--- a/gcc/gcov-io.c
+++ b/gcc/gcov-io.c
@@ -493,7 +493,9 @@ gcov_read_words (unsigned words)
const gcov_unsigned_t *result;
unsigned excess = gcov_var.length - gcov_var.offset;
- gcov_nonruntime_assert (gcov_var.mode > 0);
+ if (gcov_var.mode <= 0)
+ return NULL;
+
if (excess < words)
{
gcov_var.start += gcov_var.offset;