recent regression (last day): gcc version 6.0.0 20150522 (experimental) [trunk revision 223512] (GCC) > cat bug.f90 SUBROUTINE dbcsr_data_convert (n) COMPLEX(KIND=4), DIMENSION(:), POINTER :: s_data_c COMPLEX(KIND=8), DIMENSION(:), POINTER :: t_data_z t_data_z(1:n) = CMPLX(s_data_c(1:n), KIND=8) CALL foo() END SUBROUTINE dbcsr_data_convert > gfortran -c -O3 bug.f90 bug.f90:1:0: SUBROUTINE dbcsr_data_convert (n) ^ internal compiler error: in vect_get_vec_def_for_operand, at tree-vect-stmts.c:1484 0xd97159 vect_get_vec_def_for_operand(tree_node*, gimple_statement_base*, tree_node**) ../../gcc/gcc/tree-vect-stmts.c:1484 0xda51e3 vectorizable_store ../../gcc/gcc/tree-vect-stmts.c:5315 0xda7fbd vect_transform_stmt(gimple_statement_base*, gimple_stmt_iterator*, bool*, _slp_tree*, _slp_instance*) ../../gcc/gcc/tree-vect-stmts.c:7466 0xdc6279 vect_schedule_slp_instance ../../gcc/gcc/tree-vect-slp.c:3502 0xdc6a90 vect_schedule_slp(_loop_vec_info*, _bb_vec_info*) ../../gcc/gcc/tree-vect-slp.c:3572 0xdafdf7 vect_transform_loop(_loop_vec_info*) ../../gcc/gcc/tree-vect-loop.c:6165 0xdcea3e vectorize_loops() ../../gcc/gcc/tree-vectorizer.c:502 Please submit a full bug report,
Mine.
I have a fix for the ICE: Index: gcc/tree-vect-stmts.c =================================================================== --- gcc/tree-vect-stmts.c (revision 223529) +++ gcc/tree-vect-stmts.c (working copy) @@ -3964,14 +3964,12 @@ vectorizable_conversion (gimple stmt, gi if (slp_node) SLP_TREE_VEC_STMTS (slp_node).quick_push (new_stmt); + + if (!prev_stmt_info) + STMT_VINFO_VEC_STMT (stmt_info) = new_stmt; else - { - if (!prev_stmt_info) - STMT_VINFO_VEC_STMT (stmt_info) = new_stmt; - else - STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt; - prev_stmt_info = vinfo_for_stmt (new_stmt); - } + STMT_VINFO_RELATED_STMT (prev_stmt_info) = new_stmt; + prev_stmt_info = vinfo_for_stmt (new_stmt); } } but I'm not sure we create correct code here. The strided-store path looks wrong to me. Micha? vect__19.9_70 = [vec_unpack_lo_expr] vect_cst_.8_69; vect__19.9_71 = [vec_unpack_hi_expr] vect_cst_.8_69; _21 = (real(kind=8)) _20; _82 = BIT_FIELD_REF <vect__19.9_70, 64, 0>; MEM[(real(kind=8) *)ivtmp_72] = _82; ivtmp_84 = ivtmp_72 + _81; _85 = BIT_FIELD_REF <vect__19.9_70, 64, 64>; MEM[(real(kind=8) *)ivtmp_84] = _85; we load a v4sf and unpack to two v2df vectors (unrolling factor of two is applied). But then the strided store code appears to just store from the first vector, the realpart to the first unrolled iteration destination realpart and the imagpart to the second unrolled interation realpart!? (gdb) p ncopies $1 = 1 (gdb) p vec_num $2 = 2 you somehow miss the loop over vec_num. Or you miss to reject the testcase for strided stores (possibly our patches just crossed here). That is, SLP support seems to be absent here. Joost - can you produce a runtime testcase that verifies correctness? Meanwhile testing the ICE fixing patch.
Author: rguenth Date: Fri May 22 12:34:46 2015 New Revision: 223552 URL: https://gcc.gnu.org/viewcvs?rev=223552&root=gcc&view=rev Log: 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. * gfortran.fortran-torture/compile/pr66251.f90: New testcase. Added: trunk/gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-stmts.c
ICE fixed, handing over to Micha.
(In reply to Richard Biener from comment #2) > I have a fix for the ICE: thanks! > but I'm not sure we create correct code here. > Joost - can you produce a runtime testcase that verifies correctness? well spotted... the following fails with obviously wrong results: > cat bug.f90 MODULE M1 CONTAINS SUBROUTINE dbcsr_data_convert (s_data_c,t_data_z,n) COMPLEX(KIND=4), DIMENSION(:), POINTER :: s_data_c COMPLEX(KIND=8), DIMENSION(:), POINTER :: t_data_z t_data_z(1:n) = CMPLX(s_data_c(1:n), KIND=8) END SUBROUTINE dbcsr_data_convert END MODULE M1 USE M1 INTEGER :: n=2 COMPLEX(KIND=4), DIMENSION(:), POINTER :: s_data_c COMPLEX(KIND=8), DIMENSION(:), POINTER :: t_data_z REAL(KIND=8) :: diff ALLOCATE(s_data_c(n),t_data_z(n)) s_data_c=(/(i,i=1,n)/)+(/(i,i=1,n)/)*(0,42) call dbcsr_data_convert (s_data_c,t_data_z,n) diff=ABS(t_data_z(n)-s_data_c(n)) IF (diff>2*EPSILON(1.0_4)) THEN write(6,*) s_data_c write(6,*) t_data_z CALL ABORT() ENDIF END > gfortran -O3 -march=native -fno-inline bug.f90 ; ./a.out ( 1.00000000 , 42.0000000 ) ( 2.00000000 , 84.0000000 ) ( 1.0000000000000000 , 1.0242026242921894E-312) ( 42.000000000000000 , 0.0000000000000000 ) Program aborted. Backtrace: #0 0x7F593AA0CC97 #1 0x7F593AA0DAD2 #2 0x7F593AADD128 #3 0x401233 in MAIN__ at bug.f90:? Aborted
Author: matz Date: Tue May 26 16:00:32 2015 New Revision: 223704 URL: https://gcc.gnu.org/viewcvs?rev=223704&root=gcc&view=rev Log: PR middle-end/66251 * tree-vect-stmts.c (vect_model_store_cost): Handled strided group stores. (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. (vectorizable_store): Handle strided group stores. testsuite/: PR middle-end/66251 * gcc.dg/vect/pr66251.c: New test. Added: trunk/gcc/testsuite/gcc.dg/vect/pr66251.c Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-stmts.c
fixed.
Fixed.
Author: rguenth Date: Mon Jun 1 07:37:52 2015 New Revision: 223911 URL: https://gcc.gnu.org/viewcvs?rev=223911&root=gcc&view=rev Log: 2015-06-01 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. * gcc.dg/vect/pr66251.c: New test. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. * gfortran.fortran-torture/compile/pr66251.f90: New testcase. Added: branches/gcc-5-branch/gcc/testsuite/gcc.dg/vect/pr66251.c branches/gcc-5-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/testsuite/ChangeLog branches/gcc-5-branch/gcc/tree-vect-stmts.c
Author: rguenth Date: Wed Jun 3 11:03:26 2015 New Revision: 224072 URL: https://gcc.gnu.org/viewcvs?rev=224072&root=gcc&view=rev Log: 2015-06-03 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. * gcc.dg/vect/pr66251.c: New test. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. * gfortran.fortran-torture/compile/pr66251.f90: New testcase. 2015-05-27 Richard Biener <rguenther@suse.de> PR tree-optimization/66272 Revert parts of 2014-08-15 Richard Biener <rguenther@suse.de> PR tree-optimization/62031 * tree-data-ref.c (dr_analyze_indices): Do not set DR_UNCONSTRAINED_BASE. (dr_may_alias_p): All indirect accesses have to go the formerly DR_UNCONSTRAINED_BASE path. * tree-data-ref.h (struct indices): Remove unconstrained_base member. (DR_UNCONSTRAINED_BASE): Remove. * gcc.dg/torture/pr66272.c: New testcase. 2015-05-13 Richard Biener <rguenther@suse.de> PR tree-optimization/66123 * tree-ssa-dom.c (propagate_rhs_into_lhs): Check if we found a taken edge. * gcc.dg/torture/pr66123.c: New testcase. 2015-06-02 Richard Biener <rguenther@suse.de> PR debug/65549 * dwarf2out.c (lookup_context_die): New function. (resolve_addr): Avoid forcing a full DIE for the target of a DW_TAG_GNU_call_site during late compilation. Instead create a stub DIE without a type if we have a context DIE present. * g++.dg/lto/pr65549_0.C: New testcase. 2015-03-23 Richard Biener <rguenther@suse.de> PR tree-optimization/65518 * tree-vect-stmts.c (vectorizable_load): Reject single-element interleaving cases we generate absymal code for. * gcc.dg/vect/pr65518.c: New testcase. Added: branches/gcc-4_9-branch/gcc/testsuite/g++.dg/lto/pr65549_0.C branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr66123.c branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/torture/pr66272.c branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr65518.c branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr66251.c branches/gcc-4_9-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/dwarf2out.c branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/tree-data-ref.c branches/gcc-4_9-branch/gcc/tree-data-ref.h branches/gcc-4_9-branch/gcc/tree-ssa-dom.c branches/gcc-4_9-branch/gcc/tree-vect-stmts.c
Author: rguenth Date: Wed Jun 3 13:50:11 2015 New Revision: 224081 URL: https://gcc.gnu.org/viewcvs?rev=224081&root=gcc&view=rev Log: 2015-06-03 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. * gcc.dg/vect/pr66251.c: New test. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. * gfortran.fortran-torture/compile/pr66251.f90: New testcase. 2015-03-23 Richard Biener <rguenther@suse.de> PR tree-optimization/65518 * tree-vect-stmts.c (vectorizable_load): Reject single-element interleaving cases we generate absymal code for. * gcc.dg/vect/pr65518.c: New testcase. 2015-05-13 Richard Biener <rguenther@suse.de> PR tree-optimization/66123 * tree-ssa-dom.c (propagate_rhs_into_lhs): Check if we found a taken edge. * gcc.dg/torture/pr66123.c: New testcase. 2015-05-27 Richard Biener <rguenther@suse.de> PR tree-optimization/66272 Revert parts of 2014-08-15 Richard Biener <rguenther@suse.de> PR tree-optimization/62031 * tree-data-ref.c (dr_analyze_indices): Do not set DR_UNCONSTRAINED_BASE. (dr_may_alias_p): All indirect accesses have to go the formerly DR_UNCONSTRAINED_BASE path. * tree-data-ref.h (struct indices): Remove unconstrained_base member. (DR_UNCONSTRAINED_BASE): Remove. * gcc.dg/torture/pr66272.c: New testcase. Added: branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr66123.c branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/torture/pr66272.c branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr65518.c branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr66251.c branches/gcc-4_8-branch/gcc/testsuite/gfortran.fortran-torture/compile/pr66251.f90 Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/testsuite/ChangeLog branches/gcc-4_8-branch/gcc/tree-data-ref.c branches/gcc-4_8-branch/gcc/tree-data-ref.h branches/gcc-4_8-branch/gcc/tree-ssa-dom.c branches/gcc-4_8-branch/gcc/tree-vect-stmts.c
I'm getting: FAIL: gcc.dg/vect/pr66251.c scan-tree-dump-times vect "vectorized 1 loops" 2 FAIL: gcc.dg/vect/pr66251.c -flto -ffat-lto-objects scan-tree-dump-times vect "vectorized 1 loops" 2 on the 4.9 branch (both x86_64 and i686-linux).
On 4.8 branch as well.
Author: rguenth Date: Thu Jun 4 11:10:47 2015 New Revision: 224123 URL: https://gcc.gnu.org/viewcvs?rev=224123&root=gcc&view=rev Log: 2015-06-04 Richard Biener <rguenther@suse.de> PR middle-end/66251 * gcc.dg/vect/pr66251.c: Fix expected vectorization. Modified: branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/testsuite/gcc.dg/vect/pr66251.c
Author: rguenth Date: Thu Jun 4 11:11:36 2015 New Revision: 224124 URL: https://gcc.gnu.org/viewcvs?rev=224124&root=gcc&view=rev Log: 2015-06-04 Richard Biener <rguenther@suse.de> PR middle-end/66251 * gcc.dg/vect/pr66251.c: Fix expected vectorization. Modified: branches/gcc-4_8-branch/gcc/testsuite/ChangeLog branches/gcc-4_8-branch/gcc/testsuite/gcc.dg/vect/pr66251.c
Author: rguenth Date: Tue Jun 16 14:25:55 2015 New Revision: 224520 URL: https://gcc.gnu.org/viewcvs?rev=224520&root=gcc&view=rev Log: 2015-06-16 Richard Biener <rguenther@suse.de> Revert 2015-06-01 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. Modified: branches/gcc-5-branch/gcc/ChangeLog branches/gcc-5-branch/gcc/tree-vect-stmts.c
Author: rguenth Date: Tue Jun 16 14:56:50 2015 New Revision: 224522 URL: https://gcc.gnu.org/viewcvs?rev=224522&root=gcc&view=rev Log: 2015-06-16 Richard Biener <rguenther@suse.de> Revert 2015-06-01 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/tree-vect-stmts.c
Author: rguenth Date: Tue Jun 16 15:00:03 2015 New Revision: 224523 URL: https://gcc.gnu.org/viewcvs?rev=224523&root=gcc&view=rev Log: 2015-06-16 Richard Biener <rguenther@suse.de> Revert 2015-06-01 Richard Biener <rguenther@suse.de> Backport from mainline 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. Modified: branches/gcc-4_8-branch/gcc/ChangeLog branches/gcc-4_8-branch/gcc/tree-vect-stmts.c
Author: rguenth Date: Wed Jun 17 07:37:40 2015 New Revision: 224545 URL: https://gcc.gnu.org/viewcvs?rev=224545&root=gcc&view=rev Log: 2015-06-17 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_store): Fix gathering of vectorized stmts for SLP strided stores. * gfortran.fortran-torture/compile/pr66251-2.f90: New testcase. Revert 2015-05-22 Richard Biener <rguenther@suse.de> PR tree-optimization/66251 * tree-vect-stmts.c (vectorizable_conversion): Properly set STMT_VINFO_VEC_STMT even for the SLP case. 2015-05-26 Michael Matz <matz@suse.de> PR middle-end/66251 * tree-vect-stmts.c (vect_create_vectorized_demotion_stmts): Always set STMT_VINFO_VEC_STMT, also with SLP. Added: trunk/gcc/testsuite/gfortran.fortran-torture/compile/pr66251-2.f90 Modified: trunk/gcc/ChangeLog trunk/gcc/testsuite/ChangeLog trunk/gcc/tree-vect-stmts.c