aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.4.3/gcc/tree-ssa-ccp.c
diff options
context:
space:
mode:
authorAndrew Hsieh <andrewhsieh@google.com>2013-05-27 09:29:24 +0800
committerAndrew Hsieh <andrewhsieh@google.com>2013-05-27 09:33:02 +0800
commit53ac5cd1ae9fe073c4c14d3e068f778bfc1999d4 (patch)
treed16a9d616bbbb92f26ba2d41196a0daf381203c8 /gcc-4.4.3/gcc/tree-ssa-ccp.c
parentf63aa0156b8ef6b30304890529cbf642e8f78ebd (diff)
downloadtoolchain_gcc-53ac5cd1ae9fe073c4c14d3e068f778bfc1999d4.tar.gz
toolchain_gcc-53ac5cd1ae9fe073c4c14d3e068f778bfc1999d4.tar.bz2
toolchain_gcc-53ac5cd1ae9fe073c4c14d3e068f778bfc1999d4.zip
[4.4.3] Backport of the patch from trunk/4.8 for fixing issue 54623
2013-05-24 Alexander Ivchenko <alexander.ivchenko@intel.com> PR tree-ssa/57385 * tree-ssa-sccvn.c (fully_constant_vn_reference_p): Check that index is not negative. See f63aa0156b8ef6b30304890529cbf642e8f78ebd and https://code.google.com/p/android/issues/detail?id=54623 Change-Id: I3dbba928565414575b9438bb1467fec21506fbc8
Diffstat (limited to 'gcc-4.4.3/gcc/tree-ssa-ccp.c')
-rw-r--r--gcc-4.4.3/gcc/tree-ssa-ccp.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/gcc-4.4.3/gcc/tree-ssa-ccp.c b/gcc-4.4.3/gcc/tree-ssa-ccp.c
index 6f15c0c42..f029e0dfe 100644
--- a/gcc-4.4.3/gcc/tree-ssa-ccp.c
+++ b/gcc-4.4.3/gcc/tree-ssa-ccp.c
@@ -1238,6 +1238,7 @@ fold_const_aggregate_ref (tree t)
&& (GET_MODE_CLASS (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor))))
== MODE_INT)
&& GET_MODE_SIZE (TYPE_MODE (TREE_TYPE (TREE_TYPE (ctor)))) == 1
+ && tree_int_cst_sgn (idx) >= 0
&& compare_tree_int (idx, TREE_STRING_LENGTH (ctor)) < 0)
return build_int_cst_type (TREE_TYPE (t),
(TREE_STRING_POINTER (ctor)