re PR fortran/71687 (ICE in omp_add_variable, at gimplify.c:5821)
authorJakub Jelinek <jakub@redhat.com>
Fri, 1 Jul 2016 20:52:54 +0000 (22:52 +0200)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 1 Jul 2016 20:52:54 +0000 (22:52 +0200)
commit79a592e33e39e2a7d7c2f6180e963074908a15a7
treea3ddb9cca844feca67466281ebedca4796fe9577
parente2298656eb195614bcf70e385ddf44a4b137a081
re PR fortran/71687 (ICE in omp_add_variable, at gimplify.c:5821)

PR fortran/71687
* f95-lang.c (struct binding_level): Add reversed field.
(clear_binding_level): Adjust initializer.
(getdecls): If reversed is clear, set it and nreverse the names
chain before returning it.
(poplevel): Use getdecls.
* trans-decl.c (gfc_generate_function_code, gfc_process_block_locals):
Use nreverse to pushdecl decls in the declaration order.

* gfortran.dg/gomp/pr71687.f90: New test.

From-SVN: r237926
gcc/fortran/ChangeLog
gcc/fortran/f95-lang.c
gcc/fortran/trans-decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/gomp/pr71687.f90 [new file with mode: 0644]