OSDN Git Service

2009-09-29 Daniel Kraft <d@domob.eu>
authordomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Sep 2009 07:42:42 +0000 (07:42 +0000)
committerdomob <domob@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 29 Sep 2009 07:42:42 +0000 (07:42 +0000)
commit6a7084d700f33c25ffdfe5e213b60f05785ba87c
tree8bbc9942644ae27a9137a47480f2dfeeba5ab54c
parentcd0a387eb20d8d4505cd3f66a3b9d01f641bb42e
2009-09-29  Daniel Kraft  <d@domob.eu>

PR fortran/39626
* gfortran.h (enum gfc_statement): Add ST_BLOCK and ST_END_BLOCK.
(struct gfc_namespace): Convert flags to bit-fields and add flag
`construct_entities' for use with BLOCK constructs.
(enum gfc_exec_code): Add EXEC_BLOCK.
(struct gfc_code): Add namespace field to union for EXEC_BLOCK.
* match.h (gfc_match_block): New prototype.
* parse.h (enum gfc_compile_state): Add COMP_BLOCK.
* trans.h (gfc_process_block_locals): New prototype.
(gfc_trans_deferred_vars): Made public, new prototype.
* trans-stmt.h (gfc_trans_block_construct): New prototype.
* decl.c (gfc_match_end): Handle END BLOCK correctly.
(gfc_match_intent): Error if inside of BLOCK.
(gfc_match_optional), (gfc_match_value): Ditto.
* match.c (gfc_match_block): New routine.
* parse.c (decode_statement): Handle BLOCK statement.
(case_exec_markers): Add ST_BLOCK.
(case_end): Add ST_END_BLOCK.
(gfc_ascii_statement): Handle ST_BLOCK and ST_END_BLOCK.
(parse_spec): Check for statements not allowed inside of BLOCK.
(parse_block_construct): New routine.
(parse_executable): Parse BLOCKs.
(parse_progunit): Disallow CONTAINS in BLOCK constructs.
* resolve.c (is_illegal_recursion): Find real container procedure and
don't get confused by BLOCK constructs.
(resolve_block_construct): New routine.
(gfc_resolve_blocks), (resolve_code): Handle EXEC_BLOCK.
* st.c (gfc_free_statement): Handle EXEC_BLOCK statements.
* trans-decl.c (saved_local_decls): New static variable.
(add_decl_as_local): New routine.
(gfc_finish_var_decl): Add variable as local if inside BLOCK.
(gfc_trans_deferred_vars): Make public.
(gfc_process_block_locals): New routine.
* trans-stmt.c (gfc_trans_block_construct): New routine.
* trans.c (gfc_trans_code): Handle EXEC_BLOCK statements.

2009-09-29  Daniel Kraft  <d@domob.eu>

PR fortran/39626
* gfortran.dg/block_1.f08: New test.
* gfortran.dg/block_2.f08: New test.
* gfortran.dg/block_3.f90: New test.
* gfortran.dg/block_4.f08: New test.
* gfortran.dg/block_5.f08: New test.
* gfortran.dg/block_6.f08: New test.
* gfortran.dg/block_7.f08: New test.
* gfortran.dg/block_8.f08: New test.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@152266 138bc75d-0d04-0410-961f-82ee72b054a4
23 files changed:
gcc/fortran/ChangeLog
gcc/fortran/decl.c
gcc/fortran/gfortran.h
gcc/fortran/match.c
gcc/fortran/match.h
gcc/fortran/parse.c
gcc/fortran/parse.h
gcc/fortran/resolve.c
gcc/fortran/st.c
gcc/fortran/trans-decl.c
gcc/fortran/trans-stmt.c
gcc/fortran/trans-stmt.h
gcc/fortran/trans.c
gcc/fortran/trans.h
gcc/testsuite/ChangeLog
gcc/testsuite/gfortran.dg/block_1.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_2.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_3.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_4.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_5.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_6.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_7.f08 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/block_8.f08 [new file with mode: 0644]