PIPS
|
#include <stdio.h>
#include <string.h>
#include "linear.h"
#include "genC.h"
#include "misc.h"
#include "ri.h"
#include "ri-util.h"
Go to the source code of this file.
Macros | |
#define | reached_p(s) (bound_reached_p(s)) |
A mapping to store if a given statement is reachable from the control flow point of view: More... | |
#define | continued_p(s) (load_continued(s)) |
#define | check_recursion(s) |
Functions | |
static bool | propagate (statement s) |
returns whether propagation is continued after s. More... | |
static bool | control_propagate (control c) |
void | init_reachable (statement start) |
Compute reachable infomation from the. More... | |
bool | statement_reachable_p (statement s) |
Test if the given statement is reachable from some statements given at init_reachable(start) More... | |
bool | statement_continued_p (statement s) |
Test if the execution goes on after the given statement. More... | |
void | close_reachable (void) |
Remove reachability information about previously checked statements. More... | |
#define check_recursion | ( | s | ) |
Definition at line 55 of file unreachable.c.
#define continued_p | ( | s | ) | (load_continued(s)) |
Definition at line 51 of file unreachable.c.
#define reached_p | ( | s | ) | (bound_reached_p(s)) |
A mapping to store if a given statement is reachable from the control flow point of view:
Definition at line 50 of file unreachable.c.
void close_reachable | ( | void | ) |
Remove reachability information about previously checked statements.
Definition at line 252 of file unreachable.c.
Referenced by module_name_to_preconditions(), and module_name_to_total_preconditions().
If we already have dealt with the current control node, stop the recursion:
already computed
Investigate about the continuation status of the statement:
Investigate the control successors only if the current one continues afterwards
It seems like a fallacy here. It is not semantically different if we have a cycle with more than 1 goto... It does not work for irreductible graphs either but it is detected anyway now in proagate(). RK
1 GO TO 1
Definition at line 74 of file unreachable.c.
References CAR, CDR, continued_p, CONTROL, control_statement, control_successors, gen_length(), pips_assert, pips_debug, propagate(), and reached_p.
Referenced by propagate().
void init_reachable | ( | statement | start | ) |
Compute reachable infomation from the.
start | statement. |
start | tart |
Definition at line 223 of file unreachable.c.
References debug_off, debug_on, propagate(), and start.
Referenced by module_name_to_preconditions(), and module_name_to_total_preconditions().
returns whether propagation is continued after s.
(that is no STOP or infinite loop encountered ??? ). It is a MAY information. If there is no propagation, it is a MUST information.
pips_debug(1, "Dealing with statement %p\n", s);
print_statement(s);
}
Undecidable implies "propagate" by default
Undecidable implies "propagate" by default
If the unstructured is seen as going on, test if the exit node as been marked as reachable
Since the exit node is not reached, that means that there is an infinite loop is the unstructured, so globally it is not continued:
FI: not satisfying; interprocedural control effects required here
FI: interprocedural exit possible:-(
FI: undone by the controlizer?
Definition at line 124 of file unreachable.c.
References call_function, CAR, check_recursion, control_propagate(), control_statement, ENTITY_ABORT_SYSTEM_P, ENTITY_EXIT_SYSTEM_P, ENTITY_STOP_P, exit, f(), forloop_body, instruction_call, instruction_forloop, instruction_loop, instruction_sequence, instruction_tag, instruction_test, instruction_unstructured, instruction_whileloop, is_instruction_call, is_instruction_expression, is_instruction_forloop, is_instruction_goto, is_instruction_loop, is_instruction_multitest, is_instruction_sequence, is_instruction_test, is_instruction_unstructured, is_instruction_whileloop, loop_body, pips_assert, pips_debug, pips_internal_error, POP, reached_p, sequence_statements, STATEMENT, statement_instruction, statement_undefined_p, test_false, test_true, unstructured_control, unstructured_exit, and whileloop_body.
Referenced by control_propagate(), and init_reachable().
Test if the execution goes on after the given statement.
For example it is false after a "return" in C
Definition at line 242 of file unreachable.c.
References continued_p.
Test if the given statement is reachable from some statements given at init_reachable(start)
Definition at line 234 of file unreachable.c.
References reached_p.
Referenced by statement_to_postcondition(), and statement_to_total_precondition().