diff options
author | Richard Guenther <rguenther@suse.de> | 2010-05-14 12:36:28 +0000 |
---|---|---|
committer | Richard Biener <rguenth@gcc.gnu.org> | 2010-05-14 12:36:28 +0000 |
commit | 6141b7db4599e176bddab4b4573d4e08a8284ed7 (patch) | |
tree | a71ce6cdfdeebe82a1aa1ce4bc29ca2a5d7ae297 /gcc | |
parent | 88e09c797b51a5351ae3a7c599b530cfb2708be6 (diff) | |
download | gcc-6141b7db4599e176bddab4b4573d4e08a8284ed7.zip gcc-6141b7db4599e176bddab4b4573d4e08a8284ed7.tar.gz gcc-6141b7db4599e176bddab4b4573d4e08a8284ed7.tar.bz2 |
re PR tree-optimization/44124 (valgrind reports invalid read while compiling compile/pr34091.c)
2010-05-14 Richard Guenther <rguenther@suse.de>
PR tree-optimization/44124
* tree-ssa-sccvn.c (vn_nary_may_trap): Fix invalid memory access.
From-SVN: r159390
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/tree-ssa-sccvn.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 3313434..936da30 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-05-14 Richard Guenther <rguenther@suse.de> + + PR tree-optimization/44124 + * tree-ssa-sccvn.c (vn_nary_may_trap): Fix invalid memory access. + 2010-05-14 Alan Modra <amodra@gmail.com> PR target/44075 diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f965c51..0a7feaf 100644 --- a/gcc/tree-ssa-sccvn.c +++ b/gcc/tree-ssa-sccvn.c @@ -3408,7 +3408,7 @@ bool vn_nary_may_trap (vn_nary_op_t nary) { tree type; - tree rhs2; + tree rhs2 = NULL_TREE; bool honor_nans = false; bool honor_snans = false; bool fp_operation = false; @@ -3431,7 +3431,8 @@ vn_nary_may_trap (vn_nary_op_t nary) && TYPE_OVERFLOW_TRAPS (type)) honor_trapv = true; } - rhs2 = nary->op[1]; + if (nary->length >= 2) + rhs2 = nary->op[1]; ret = operation_could_trap_helper_p (nary->opcode, fp_operation, honor_trapv, honor_nans, honor_snans, rhs2, |