diff options
-rw-r--r-- | gcc/ssa-range-gen.c | 11 | ||||
-rw-r--r-- | gcc/ssa-range-gen.h | 4 |
2 files changed, 10 insertions, 5 deletions
diff --git a/gcc/ssa-range-gen.c b/gcc/ssa-range-gen.c index 36d782dbf7e..9cf89f4eb48 100644 --- a/gcc/ssa-range-gen.c +++ b/gcc/ssa-range-gen.c @@ -1035,13 +1035,16 @@ path_ranger::path_range_of_def (irange &r, gimple *g, edge e) /* Calculate the known range for NAME on a path of basic blocks in BBS. If such a range exists, store it in R and return TRUE, - otherwise return FALSE. */ + otherwise return FALSE. + + DIR is FORWARD if BBS[0] is the definition and the last block is + the use. DIR is REVERSE if the blocks are in reverse order. */ bool -path_ranger::path_range (irange &r, tree name, const vec<basic_block> &bbs) +path_ranger::path_range (irange &r, tree name, const vec<basic_block> &bbs, + enum path_range_direction dir) { - /* Handle paths in which the blocks are reversed. */ - if (bbs.length () > 1 && find_edge (bbs[1], bbs[0])) + if (dir == REVERSE) return path_range_reverse (r, name, bbs); /* ?? Should we start with a known range for NAME? */ diff --git a/gcc/ssa-range-gen.h b/gcc/ssa-range-gen.h index f77033d19d8..12e22ed7cf4 100644 --- a/gcc/ssa-range-gen.h +++ b/gcc/ssa-range-gen.h @@ -108,13 +108,15 @@ private: void determine_block (tree name, basic_block bb, basic_block def_bb); bool path_range_reverse (irange &r, tree name, const vec<basic_block> &); public: + enum path_range_direction { FORWARD, REVERSE }; path_ranger (); /* What is the known range of name from its DEF point to edge E. */ bool path_range_edge (irange& r, tree name, edge e); bool path_range_entry (irange& r, tree name, basic_block bb); bool path_range_stmt (irange& r, tree name, gimple *g); - bool path_range (irange &r, tree name, const vec<basic_block> &bbs); + bool path_range (irange &r, tree name, const vec<basic_block> &bbs, + enum path_range_direction); // Evaluate expression within a BB as much as possible. bool path_range_of_def (irange& r, gimple *g, edge e = NULL); |