From: rguenth Date: Fri, 14 May 2010 12:36:28 +0000 (+0000) Subject: 2010-05-14 Richard Guenther X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=888b74b647d04cd0eaa170311869dae090a8ca23;p=thirdparty%2Fgcc.git 2010-05-14 Richard Guenther PR tree-optimization/44124 * tree-ssa-sccvn.c (vn_nary_may_trap): Fix invalid memory access. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@159390 138bc75d-0d04-0410-961f-82ee72b054a4 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 33134343782d..936da30123c0 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2010-05-14 Richard Guenther + + PR tree-optimization/44124 + * tree-ssa-sccvn.c (vn_nary_may_trap): Fix invalid memory access. + 2010-05-14 Alan Modra PR target/44075 diff --git a/gcc/tree-ssa-sccvn.c b/gcc/tree-ssa-sccvn.c index f965c5134e5c..0a7feafe0d7f 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,