+2019-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/83246
+ PR fortran/89084
+ * trans-decl.c (generate_local_decl): Add referenced FL_PARAMETERs
+ if sym->ns->construct_entities rather than if
+ sym->ns->parent->code->op == EXEC_BLOCK.
+
2019-01-31 Thomas Koenig <tkoenig@gcc.gnu.org>
PR fortran/88669
"imported at %L", sym->name, &sym->declared_at);
}
- if (sym->ns
- && sym->ns->parent
- && sym->ns->parent->code
- && sym->ns->parent->code->op == EXEC_BLOCK)
+ if (sym->ns && sym->ns->construct_entities)
{
if (sym->attr.referenced)
gfc_get_symbol_decl (sym);
+2019-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/83246
+ PR fortran/89084
+ * gfortran.dg/pr89084.f90: New test.
+ * gfortran.dg/lto/pr89084_0.f90: New test.
+ * gfortran.dg/pr83246.f90: New test.
+
2019-02-01 Marek Polacek <polacek@redhat.com>
PR c++/88325 - ICE with invalid out-of-line template member definition.
--- /dev/null
+! PR fortran/89084
+! { dg-lto-do link }
+! { dg-lto-options {{ -O0 -flto }} }
+
+integer function foo ()
+ write (*,*) 'foo'
+ block
+ integer, parameter :: idxs(3) = (/ 1, 2, 3 /)
+ integer :: i
+ foo = 0
+ do i = 1, size(idxs)
+ foo = foo + idxs(i)
+ enddo
+ end block
+end function foo
+program pr89084
+ integer :: i
+ interface
+ integer function foo ()
+ end function
+ end interface
+ i = foo ()
+ if (i.ne.6) stop 1
+end
--- /dev/null
+! PR fortran/83246
+! { dg-do link }
+ program dusty_corner
+ write(*,*)'BLOCK TESTS'
+ MAKEDATAP: block
+ integer,parameter :: scratch(*)=[1,2,3]
+ write(*,*)scratch
+ endblock MAKEDATAP
+ end program dusty_corner
--- /dev/null
+! PR fortran/89084
+! { dg-do run }
+
+integer function foo ()
+ write (*,*) 'foo'
+ block
+ integer, parameter :: idxs(3) = (/ 1, 2, 3 /)
+ integer :: i
+ foo = 0
+ do i = 1, size(idxs)
+ foo = foo + idxs(i)
+ enddo
+ end block
+end function foo
+program pr89084
+ integer :: i
+ interface
+ integer function foo ()
+ end function
+ end interface
+ i = foo ()
+ if (i.ne.6) stop 1
+end