Bug 51704 - [4.7 Regression] ICE: vector VEC(vec_void_p,base) index domain error, in vinfo_for_stmt at tree-vectorizer.h:620 with -O3 -fno-tree-copy-prop -fno-tree-fre
Summary: [4.7 Regression] ICE: vector VEC(vec_void_p,base) index domain error, in vinf...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: tree-optimization (show other bugs)
Version: 4.7.0
: P3 normal
Target Milestone: 4.7.0
Assignee: Ira Rosen
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-12-29 18:28 UTC by Zdenek Sojka
Modified: 2012-01-02 06:53 UTC (History)
1 user (show)

See Also:
Host: x86_64-pc-linux-gnu
Target: x86_64-pc-linux-gnu
Build:
Known to work: 4.6.2
Known to fail: 4.7.0
Last reconfirmed: 2011-12-29 00:00:00


Attachments
autoreduced testcase (552 bytes, text/plain)
2011-12-29 18:28 UTC, Zdenek Sojka
Details
patch (745 bytes, patch)
2012-01-01 09:43 UTC, Ira Rosen
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Zdenek Sojka 2011-12-29 18:28:47 UTC
Created attachment 26199 [details]
autoreduced testcase

Compiler output:
$ gcc -O3 -fno-tree-copy-prop -fno-tree-fre testsuite/gfortran.dg/inline_sum_1.f90
testsuite/gfortran.dg/inline_sum_1.f90: In function 'MAIN__':
testsuite/gfortran.dg/inline_sum_1.f90:14:0: internal compiler error: vector VEC(vec_void_p,base) index domain error, in vinfo_for_stmt at tree-vectorizer.h:620
Please submit a full bug report,
with preprocessed source if appropriate.
See <http://gcc.gnu.org/bugs.html> for instructions.

(gdb) bt
#0  internal_error (gmsgid=0x1526a70 "vector %s %s domain error, in %s at %s:%u") at /mnt/svn/gcc-trunk/gcc/diagnostic.c:839
#1  0x00000000012226c9 in vec_assert_fail (op=0x14e80a0 "index", struct_name=0x132b3ef "VEC(vec_void_p,base)", file=<optimized out>, line=620, 
    function=0x132ef3a "vinfo_for_stmt") at /mnt/svn/gcc-trunk/gcc/vec.c:517
#2  0x0000000000bfdff7 in VEC_vec_void_p_base_index (ix_=<optimized out>, vec_=<optimized out>, file_=<optimized out>, line_=<optimized out>, 
    function_=<optimized out>) at /mnt/svn/gcc-trunk/gcc/tree-vectorizer.h:603
#3  vinfo_for_stmt (stmt=<optimized out>) at /mnt/svn/gcc-trunk/gcc/tree-vectorizer.h:620
#4  vect_detect_hybrid_slp_stmts (node=0x1b217d0) at /mnt/svn/gcc-trunk/gcc/tree-vect-slp.c:1740
#5  0x0000000000bfe61e in vect_detect_hybrid_slp (loop_vinfo=<optimized out>) at /mnt/svn/gcc-trunk/gcc/tree-vect-slp.c:1770
#6  0x0000000000bf3b55 in vect_analyze_loop_2 (loop_vinfo=<optimized out>) at /mnt/svn/gcc-trunk/gcc/tree-vect-loop.c:1610
#7  vect_analyze_loop (loop=0x7ffff59d4550) at /mnt/svn/gcc-trunk/gcc/tree-vect-loop.c:1667
#8  0x0000000000c02ef7 in vectorize_loops () at /mnt/svn/gcc-trunk/gcc/tree-vectorizer.c:203
#9  0x0000000000960335 in execute_one_pass (pass=0x1842ba0) at /mnt/svn/gcc-trunk/gcc/passes.c:2080
#10 0x00000000009606d5 in execute_pass_list (pass=0x1842ba0) at /mnt/svn/gcc-trunk/gcc/passes.c:2135
#11 0x00000000009606e7 in execute_pass_list (pass=0x1842d80) at /mnt/svn/gcc-trunk/gcc/passes.c:2136
#12 0x00000000009606e7 in execute_pass_list (pass=0x1842000) at /mnt/svn/gcc-trunk/gcc/passes.c:2136
#13 0x0000000000ac16ae in tree_rest_of_compilation (fndecl=0x7ffff5bb5100) at /mnt/svn/gcc-trunk/gcc/tree-optimize.c:421
#14 0x000000000071715a in cgraph_expand_function (node=0x7ffff5a95c60) at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1818
#15 0x0000000000718efc in cgraph_expand_all_functions () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1885
#16 cgraph_optimize () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:2198
#17 0x000000000071966a in cgraph_finalize_compilation_unit () at /mnt/svn/gcc-trunk/gcc/cgraphunit.c:1327
#18 0x000000000090aa8d in write_global_declarations () at /mnt/svn/gcc-trunk/gcc/langhooks.c:303
#19 0x0000000000a54dec in compile_file () at /mnt/svn/gcc-trunk/gcc/toplev.c:573
#20 do_compile () at /mnt/svn/gcc-trunk/gcc/toplev.c:1935
#21 toplev_main (argc=16, argv=0x7fffffffd928) at /mnt/svn/gcc-trunk/gcc/toplev.c:2011
#22 0x00007ffff61cc09d in __libc_start_main () from /lib64/libc.so.6
#23 0x00000000005833f1 in _start ()

Tested revisions:
r182703 - crash
4.6 r180325 - OK
Comment 1 Jakub Jelinek 2011-12-29 19:55:58 UTC
Started with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=173856
Comment 2 Ira Rosen 2012-01-01 09:43:12 UTC
Created attachment 26210 [details]
patch
Comment 3 irar 2012-01-01 13:52:21 UTC
Author: irar
Date: Sun Jan  1 13:52:13 2012
New Revision: 182769

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=182769
Log:

        PR tree-optimization/51704
        * tree-vect-slp.c (vect_detect_hybrid_slp_stmts): Check that
        a use is inside the basic block or loop before accessing its
        vect info.


Added:
    trunk/gcc/testsuite/gfortran.dg/vect/no-fre-no-copy-prop-O3-pr51704.f90
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/testsuite/gfortran.dg/vect/vect.exp
    trunk/gcc/tree-vect-slp.c
Comment 4 Ira Rosen 2012-01-02 06:53:41 UTC
Fixed.