[go: nahoru, domu]

Bug 68279 - ICE: in create_pw_aff_from_tree, at graphite-sese-to-poly.c:836
Summary: ICE: in create_pw_aff_from_tree, at graphite-sese-to-poly.c:836
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: middle-end (show other bugs)
Version: 6.0
: P3 normal
Target Milestone: ---
Assignee: Sebastian Pop
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-10 20:51 UTC by Joost VandeVondele
Modified: 2015-11-23 19:34 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail: 6.0
Last reconfirmed: 2015-11-20 00:00:00


Attachments
Reduced testcase from liborc (265 bytes, text/plain)
2015-11-19 10:04 UTC, Jana Saout
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Joost VandeVondele 2015-11-10 20:51:34 UTC
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
Comment 1 Joost VandeVondele 2015-11-10 20:54:49 UTC
trying to debug a '-O3  -floop-nest-optimize' miscompile of our code, I ran into this '-O2  -floop-nest-optimize' ICE.
Comment 2 Sebastian Pop 2015-11-11 00:29:26 UTC
I'll have a look.
Comment 3 Jana Saout 2015-11-19 10:04:23 UTC
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
Comment 4 Joost VandeVondele 2015-11-20 04:35:28 UTC
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
Comment 5 Sebastian Pop 2015-11-23 17:17:33 UTC
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!
Comment 6 Joost VandeVondele 2015-11-23 17:21:53 UTC
(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
Comment 7 Sebastian Pop 2015-11-23 19:34:01 UTC
Fixed in r230771