diff options
author | Edward Smith-Rowland <3dw4rd@verizon.net> | 2017-08-12 19:09:40 +0000 |
---|---|---|
committer | Edward Smith-Rowland <3dw4rd@verizon.net> | 2017-08-12 19:09:40 +0000 |
commit | 40fa8ee5f9da161462fde48776ef6262366f9a13 (patch) | |
tree | d3c3bf913950c59ef83b8d9ede50b0978ec0c12f /gcc/tree-ssa-loop-niter.c | |
parent | 3acaf2e51caf356a9afc763cfd70b91d1ab094b5 (diff) |
Merged revisions r232323 through r251067 to the branchtr29124
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/tr29124@251068 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/tree-ssa-loop-niter.c')
-rw-r--r-- | gcc/tree-ssa-loop-niter.c | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gcc/tree-ssa-loop-niter.c b/gcc/tree-ssa-loop-niter.c index e0107c28dfb..0d6d1019ac6 100644 --- a/gcc/tree-ssa-loop-niter.c +++ b/gcc/tree-ssa-loop-niter.c @@ -42,6 +42,7 @@ along with GCC; see the file COPYING3. If not see #include "tree-chrec.h" #include "tree-scalar-evolution.h" #include "params.h" +#include "tree-dfa.h" /* The maximum number of dominator BBs we search for conditions @@ -1980,6 +1981,21 @@ expand_simple_operations (tree expr, tree stop) if (code == SSA_NAME) return expand_simple_operations (e, stop); + else if (code == ADDR_EXPR) + { + HOST_WIDE_INT offset; + tree base = get_addr_base_and_unit_offset (TREE_OPERAND (e, 0), + &offset); + if (base + && TREE_CODE (base) == MEM_REF) + { + ee = expand_simple_operations (TREE_OPERAND (base, 0), stop); + return fold_build2 (POINTER_PLUS_EXPR, TREE_TYPE (expr), ee, + wide_int_to_tree (sizetype, + mem_ref_offset (base) + + offset)); + } + } return expr; } |