diff options
Diffstat (limited to 'gcc/fortran')
| -rw-r--r-- | gcc/fortran/ChangeLog | 12 | ||||
| -rw-r--r-- | gcc/fortran/primary.c | 11 | ||||
| -rw-r--r-- | gcc/fortran/trans-stmt.c | 2 |
3 files changed, 25 insertions, 0 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 04b8c8e..44e1800 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,15 @@ +2006-09-18 Paul Thomas <pault@gcc.gnu.org> + + PR fortran/28526 + * primary.c (match_variable): If the compiler is in a module + specification block, an interface block or a contains section, + reset host_flag to force the changed symbols mechanism. + + PR fortran/29101 + * trans-stmt.c (gfc_trans_character_select): Add the post block + for the expression to the main block, after the call to + select_string and the last label. + 2006-09-18 Paul Thomas <pault@gcc.gnu.org> PR fortran/29060 diff --git a/gcc/fortran/primary.c b/gcc/fortran/primary.c index 1428f4c..6f61ad7 100644 --- a/gcc/fortran/primary.c +++ b/gcc/fortran/primary.c @@ -2283,6 +2283,17 @@ match_variable (gfc_expr ** result, int equiv_flag, int host_flag) locus where; match m; + /* Since nothing has any business being an lvalue in a module + specification block, an interface block or a contains section, + we force the changed_symbols mechanism to work by setting + host_flag to 0. This prevents valid symbols that have the name + of keywords, such as 'end', being turned into variables by + failed matching to assignments for, eg., END INTERFACE. */ + if (gfc_current_state () == COMP_MODULE + || gfc_current_state () == COMP_INTERFACE + || gfc_current_state () == COMP_CONTAINS) + host_flag = 0; + m = gfc_match_sym_tree (&st, host_flag); if (m != MATCH_YES) return m; diff --git a/gcc/fortran/trans-stmt.c b/gcc/fortran/trans-stmt.c index 97cb747..841b457 100644 --- a/gcc/fortran/trans-stmt.c +++ b/gcc/fortran/trans-stmt.c @@ -1475,6 +1475,8 @@ gfc_trans_character_select (gfc_code *code) if (n != 0) gfc_free (labels); + gfc_add_block_to_block (&block, &se.post); + return gfc_finish_block (&block); } |
