[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-24 Thread aivchenk at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

--- Comment #4 from Alexander Ivchenko aivchenk at gmail dot com ---
Bootstrapped and tested on x86_64 linux, sent to gcc-patches.

http://patchwork.ozlabs.org/patch/246036/


[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-24 Thread aivchenk at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

--- Comment #5 from Alexander Ivchenko aivchenk at gmail dot com ---
btw it indeed gives a segfault for 4.7 on linux_64 if we change the index from
-1 to some -1.

g++ .../src/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c -O1 -S -o pr57385.s
...src/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c: In function ‘void
foo(int)’:
...src/gcc/gcc/testsuite/gcc.dg/tree-ssa/pr57385.c:10:1: internal compiler
error: Segmentation fault

g++ --version
g++ (GCC) 4.7.2 20120921 (Red Hat 4.7.2-2)

[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-24 Thread aivchenk at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

--- Comment #6 from Alexander Ivchenko aivchenk at gmail dot com ---
On Fri, May 24, 2013 at 1:15 PM, Kirill Yukhin kirill.yuk...@gmail.com wrote:

 Ok for trunk and 4.8 after 4.8.1 is out.


 Checked in to trunk:
 http://gcc.gnu.org/ml/gcc-cvs/2013-05/msg00803.html (+
 http://gcc.gnu.org/ml/gcc-cvs/2013-05/msg00804.html for missed test).
 And 4.8 branch: http://gcc.gnu.org/ml/gcc-cvs/2013-05/msg00805.html

 Thanks, K


I think we can close it now.


[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-24 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution|--- |FIXED
   Target Milestone|--- |4.8.1

--- Comment #7 from Richard Biener rguenth at gcc dot gnu.org ---
Fixed.


[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-23 Thread aivchenk at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

--- Comment #1 from Alexander Ivchenko aivchenk at gmail dot com ---
Following fix could solve the problem:

diff --git a/gcc-4.6/gcc/tree-ssa-sccvn.c b/gcc-4.6/gcc/tree-ssa-sccvn.c
index eb88969..704a86c 100644
--- a/gcc-4.6/gcc/tree-ssa-sccvn.c
+++ b/gcc-4.6/gcc/tree-ssa-sccvn.c
@@ -1115,6 +1115,7 @@ fully_constant_vn_reference_p (vn_reference_t ref)
  == TYPE_MODE (TREE_TYPE (TREE_TYPE (arg0-op0
   GET_MODE_CLASS (TYPE_MODE (op-type)) == MODE_INT
   GET_MODE_SIZE (TYPE_MODE (op-type)) == 1
+  tree_int_cst_sgn (op-op0) = 0
   compare_tree_int (op-op0, TREE_STRING_LENGTH (arg0-op0))  0)
return build_int_cst_type (op-type,
   (TREE_STRING_POINTER (arg0-op0)


[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-23 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

Richard Biener rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 CC||rguenth at gcc dot gnu.org

--- Comment #2 from Richard Biener rguenth at gcc dot gnu.org ---
True.  Please post to gcc-patches and do a bootstrap/test with it.


[Bug tree-optimization/57385] [tree-ssa] Possible segfault in fully_constant_vn_reference_p

2013-05-23 Thread aivchenk at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57385

--- Comment #3 from Alexander Ivchenko aivchenk at gmail dot com ---
Testing is in progress, will send to gcc-patches rigth after that.