From 6665c6927845184e458fa2e719de198298cb5f45 Mon Sep 17 00:00:00 2001 From: Michael Tautschnig Date: Fri, 22 Jun 2018 13:39:24 +0100 Subject: [PATCH] Remove unreachable instructions --- src/cpp/parse.cpp | 2 -- src/goto-cc/as_mode.cpp | 2 +- src/pointer-analysis/goto_program_dereference.cpp | 7 ++----- src/util/simplify_expr_int.cpp | 3 --- src/util/simplify_expr_pointer.cpp | 2 -- 5 files changed, 3 insertions(+), 13 deletions(-) diff --git a/src/cpp/parse.cpp b/src/cpp/parse.cpp index f072988ed5e..c76017e16cc 100644 --- a/src/cpp/parse.cpp +++ b/src/cpp/parse.cpp @@ -2386,8 +2386,6 @@ bool Parser::optAttribute(typet &t) return false; } } - - return true; } /* diff --git a/src/goto-cc/as_mode.cpp b/src/goto-cc/as_mode.cpp index 13ace1c5b80..c8b308a056f 100644 --- a/src/goto-cc/as_mode.cpp +++ b/src/goto-cc/as_mode.cpp @@ -366,7 +366,7 @@ int as_modet::as_hybrid_binary() #else error() << "binary merging not implemented for this platform" << eom; - return 1; + result = 1; #endif return result; diff --git a/src/pointer-analysis/goto_program_dereference.cpp b/src/pointer-analysis/goto_program_dereference.cpp index 71496fabece..063af881e52 100644 --- a/src/pointer-analysis/goto_program_dereference.cpp +++ b/src/pointer-analysis/goto_program_dereference.cpp @@ -54,14 +54,11 @@ bool goto_program_dereferencet::is_valid_object( return true; // global/static #if 0 - if(valid_local_variables->find(symbol.name)!= - valid_local_variables->end()) - return true; // valid local + return valid_local_variables->find(symbol.name)!= + valid_local_variables->end(); // valid local #else return true; #endif - - return false; } void goto_program_dereferencet::dereference_failure( diff --git a/src/util/simplify_expr_int.cpp b/src/util/simplify_expr_int.cpp index 77a6900acb1..6856c6a38fc 100644 --- a/src/util/simplify_expr_int.cpp +++ b/src/util/simplify_expr_int.cpp @@ -1483,9 +1483,6 @@ bool simplify_exprt::simplify_inequality(exprt &expr) // both are not constant return simplify_inequality_not_constant(expr); } - - UNREACHABLE; - return false; } bool simplify_exprt::eliminate_common_addends( diff --git a/src/util/simplify_expr_pointer.cpp b/src/util/simplify_expr_pointer.cpp index 90e044c389d..b183c81890b 100644 --- a/src/util/simplify_expr_pointer.cpp +++ b/src/util/simplify_expr_pointer.cpp @@ -403,8 +403,6 @@ bool simplify_exprt::simplify_pointer_offset(exprt &expr) return false; } - - return true; } return true;