with gcc version 6.0.0 20151110 (experimental) [trunk revision 230080] (GCC) > gfortran -c -O2 -floop-nest-optimize bug.f90 internal compiler error: in create_pw_aff_from_tree, at graphite-sese-to-poly.c:836 0x1252a13 create_pw_aff_from_tree ../../gcc/gcc/graphite-sese-to-poly.c:836 0x1252a13 create_pw_aff_from_tree ../../gcc/gcc/graphite-sese-to-poly.c:831 0x1258c9b add_condition_to_pbb ../../gcc/gcc/graphite-sese-to-poly.c:849 0x1258c9b add_conditions_to_domain ../../gcc/gcc/graphite-sese-to-poly.c:917 0x1258c9b add_conditions_to_constraints ../../gcc/gcc/graphite-sese-to-poly.c:940 0x1258c9b build_poly_scop(scop*) ../../gcc/gcc/graphite-sese-to-poly.c:1840 0x124773b graphite_transform_loops() ../../gcc/gcc/graphite.c:332 0x1247bd0 graphite_transforms ../../gcc/gcc/graphite.c:367 0x1247bd0 execute ../../gcc/gcc/graphite.c:444 Please submit a full bug report, > cat bug.f90 MODULE dbcsr_mm_accdrv INTEGER, SAVE :: accdrv_binning_nbins = 4096 INTEGER, SAVE :: accdrv_binning_binsize = 16 INTEGER, PARAMETER, PUBLIC :: dbcsr_ps_width = 7 CONTAINS SUBROUTINE stack_binning(params_in, params_out, stack_size) INTEGER, INTENT(IN) :: stack_size INTEGER, DIMENSION(dbcsr_ps_width, & stack_size), INTENT(OUT) :: params_out INTEGER, DIMENSION(dbcsr_ps_width, & stack_size), INTENT(IN) :: params_in INTEGER, DIMENSION(accdrv_binning_nbins) :: bin_top INTEGER, DIMENSION(dbcsr_ps_width) :: val INTEGER, DIMENSION(dbcsr_ps_width, & accdrv_binning_binsize, & accdrv_binning_nbins) :: bin_arr DO i=1,stack_size val(:) = params_in(:,i) IF(bin_top(bin_id) > accdrv_binning_binsize) THEN params_out(:, top:top+bin_top(bin_id)-2) = bin_arr(:, 1:bin_top(bin_id)-1, bin_id) ENDIF bin_arr(:, bin_top(bin_id), bin_id) = val(:) bin_top(bin_id) = bin_top(bin_id) + 1 END DO END SUBROUTINE stack_binning
trying to debug a '-O3 -floop-nest-optimize' miscompile of our code, I ran into this '-O2 -floop-nest-optimize' ICE.
I'll have a look.
Created attachment 36769 [details] Reduced testcase from liborc Hi, I am probably hitting the same bug when trying to compile liborc. Here's a reduced testcase that still triggers the ICE for me: gcc -O2 -ftree-loop-linear -c create_pw_aff_from_tree-ice.c -o create_pw_aff_from_tree-ice.o create_pw_aff_from_tree-ice.c: In function 'orc_compiler_sse_init': create_pw_aff_from_tree-ice.c:11:6: internal compiler error: in create_pw_aff_from_tree, at graphite-ssse-to-poly.c:713 void orc_compiler_sse_init (OrcCompiler *compiler) ^~~~~~~~~~~~~~~~~~~~~ Please submit a full bug report, with preprocessed source if appropriate
still happens at r230637 I notice the Fortran testcase misses its last line, for completeness: > cat PR68279.f90 MODULE dbcsr_mm_accdrv INTEGER, SAVE :: accdrv_binning_nbins = 4096 INTEGER, SAVE :: accdrv_binning_binsize = 16 INTEGER, PARAMETER, PUBLIC :: dbcsr_ps_width = 7 CONTAINS SUBROUTINE stack_binning(params_in, params_out, stack_size) INTEGER, INTENT(IN) :: stack_size INTEGER, DIMENSION(dbcsr_ps_width, & stack_size), INTENT(OUT) :: params_out INTEGER, DIMENSION(dbcsr_ps_width, & stack_size), INTENT(IN) :: params_in INTEGER, DIMENSION(accdrv_binning_nbins) :: bin_top INTEGER, DIMENSION(dbcsr_ps_width) :: val INTEGER, DIMENSION(dbcsr_ps_width, & accdrv_binning_binsize, & accdrv_binning_nbins) :: bin_arr DO i=1,stack_size val(:) = params_in(:,i) IF(bin_top(bin_id) > accdrv_binning_binsize) THEN params_out(:, top:top+bin_top(bin_id)-2) = bin_arr(:, 1:bin_top(bin_id)-1, bin_id) ENDIF bin_arr(:, bin_top(bin_id), bin_id) = val(:) bin_top(bin_id) = bin_top(bin_id) + 1 END DO END SUBROUTINE stack_binning END MODULE
After fixing the graphite fail, I get these warnings from the testcase in comment4: FAIL: gfortran.dg/graphite/pr68279.f90 -O (test for excess errors) Excess errors: /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:21:19: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:22:25: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:22:41: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:22:29: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:22:75: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:22:86: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:24:27: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:24:36: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:25:16: Warning: Legacy Extension: REAL array index at (1) /work/spop/gcc/gcc/testsuite/gfortran.dg/graphite/pr68279.f90:25:34: Warning: Legacy Extension: REAL array index at (1) Is there a flag I can set to avoid these warnings? Thanks!
(In reply to Sebastian Pop from comment #5) > After fixing the graphite fail, I get these warnings from the testcase in thanks, these are due to reducing the testcase stripping variable definitions. > Is there a flag I can set to avoid these warnings? gfortran -c -std=legacy t.f90
Fixed in r230771