https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63980
Bug ID: 63980
Summary: ICE: -O0 -fsanitize=undefined
-fno-sanitize=object-size
Product: gcc
Version: 5.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: sanitizer
Assignee: unassigned at gcc dot gnu.org
Reporter: Joost.VandeVondele at mat dot ethz.ch
CC: dodji at gcc dot gnu.org, dvyukov at gcc dot gnu.org,
jakub at gcc dot gnu.org, kcc at gcc dot gnu.org
current trunk ICEs at -O0 with -fsanitize=undefined -fno-sanitize=object-size
> cat bug.f90
MODULE eip_silicon
CONTAINS
SUBROUTINE eip_lenosky_silicon(nat,alat,rxyz0,fxyz,&
ener,coord,ener_var, coord_var,count)
INTEGER, ALLOCATABLE, DIMENSION(:,:,:,:) :: icell
IF (npr.le.1) THEN
IF (ii.gt.ncx) THEN
ENDIF
ALLOCATE(icell(0:ncx,-1:ll1,-1:ll2,-1:ll3))
ENDIF
END SUBROUTINE eip_lenosky_silicon
END MODULE eip_silicon
> gfortran -c -cpp -ffree-form -fsanitize=undefined -fno-sanitize=object-size
> bug.f90
gfortran: internal compiler error: Segmentation fault (program f951)
0x40c116 execute
../../gcc/gcc/gcc.c:2912
0x40c2ae do_spec_1
../../gcc/gcc/gcc.c:4837
0x40e94b process_brace_body
../../gcc/gcc/gcc.c:6120
0x40e94b handle_braces
../../gcc/gcc/gcc.c:6034
0x40cb71 do_spec_1
../../gcc/gcc/gcc.c:5491
0x40e94b process_brace_body
../../gcc/gcc/gcc.c:6120
0x40e94b handle_braces
../../gcc/gcc/gcc.c:6034
0x40cb71 do_spec_1
../../gcc/gcc/gcc.c:5491
0x40c9de do_spec_1
../../gcc/gcc/gcc.c:5606
0x40e94b process_brace_body
../../gcc/gcc/gcc.c:6120
0x40e94b handle_braces
../../gcc/gcc/gcc.c:6034
0x40cb71 do_spec_1
../../gcc/gcc/gcc.c:5491
0x40e94b process_brace_body
../../gcc/gcc/gcc.c:6120
0x40e94b handle_braces
../../gcc/gcc/gcc.c:6034
0x40cb71 do_spec_1
../../gcc/gcc/gcc.c:5491
0x40def3 do_spec_2
../../gcc/gcc/gcc.c:4538
0x410568 do_spec(char const*)
../../gcc/gcc/gcc.c:4505
0x410987 driver::do_spec_on_infiles() const
../../gcc/gcc/gcc.c:7674
0x410ff0 driver::main(int, char**)
../../gcc/gcc/gcc.c:6911
Please submit a full bug report,