From 1bba63a77e3ed0a3420eaa905f753614d5ec99d5 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Mon, 30 May 2016 18:13:12 +0000 Subject: 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 * auto-profile.c (read_profile): Replace asserts with errors when file does not exist. * gcov-io.c (gcov_read_words): Dito. From-SVN: r236894 --- gcc/gcov-io.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gcc/gcov-io.c') 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; -- cgit v1.1