https://gcc.gnu.org/bugzilla/show_bug.cgi?id=92087
Bug ID: 92087 Summary: Do front-end optimization and warnings using basic blocks and value or propagation Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran Assignee: unassigned at gcc dot gnu.org Reporter: tkoenig at gcc dot gnu.org Target Milestone: --- Doing some optimization work in the front end using value propagation could be a win. For example, an error could be issued for allocate (a(100)) do i=0,100 a(i) =... or we could make sure never to warn for real :: a(6) do i=1,5 if (i < 6) a(i) = 42. if we had range propagation. This could also help with subroutine foo (a,n) real :: a(n) ... do i=,n a(n+1) = a(n) + 1. end do which we currently do not warn about because it would be legal if the user changed n before reaching the DO loop. Regarding optimization, we should not try to do what the middle-end already does, so the focus should be on Fortran-specific constructs, especially array handling.