Testcase: subroutine mysub(n,v) integer :: n real :: v(n) if (n<=0) return do i=1, n v(i) = i*i end do return end subroutine mysub ------ Compile with -fbounds-checking -O2, and notice that there is still _gfortran_runtime_error left in the asm.
-- Summary: VRP does not remove -fbounds-checking for Fortran Product: gcc Version: 4.2.0 Status: UNCONFIRMED Keywords: missed-optimization Severity: enhancement Priority: P3 Component: tree-optimization AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: pinskia at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25643