summaryrefslogtreecommitdiff
path: root/gcc/fortran
diff options
context:
space:
mode:
authorbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-19 10:29:54 +0000
committerbstarynk <bstarynk@138bc75d-0d04-0410-961f-82ee72b054a4>2011-01-19 10:29:54 +0000
commit5b9a94504088e7452ea562233e9643e0d8205df6 (patch)
treefc86c19aa122e91770ae23801d19b8a249fe74d7 /gcc/fortran
parent01c7add04011110f55f1f7b662ab1b8dc99ed9d4 (diff)
downloadgcc-5b9a94504088e7452ea562233e9643e0d8205df6.tar.gz
2011-01-19 Basile Starynkevitch <basile@starynkevitch.net>
MELT branch merged with trunk rev 168984 2011-01-19 Basile Starynkevitch <basile@starynkevitch.net> * gcc/melt/warmelt-outobj.melt (generate_runtypesupport_mapfun): Correct some typos in generated code. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/branches/melt-branch@168988 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r--gcc/fortran/ChangeLog23
-rw-r--r--gcc/fortran/gfortran.h3
-rw-r--r--gcc/fortran/invoke.texi2
-rw-r--r--gcc/fortran/openmp.c25
-rw-r--r--gcc/fortran/resolve.c9
-rw-r--r--gcc/fortran/trans-expr.c5
6 files changed, 64 insertions, 3 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index a51003c54b0..8bf90a95b04 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,26 @@
+2011-01-18 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/47240
+ * resolve.c (expression_rank): Fix rank of procedure poiner components.
+ * trans-expr.c (gfc_conv_procedure_call): Take care of procedure
+ pointer components as actual arguments.
+
+2011-01-17 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/47331
+ * gfortran.h (struct gfc_omp_saved_state): New type.
+ (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New prototypes.
+ * resolve.c (resolve_global_procedure): Call it around gfc_resolve
+ call.
+ * openmp.c (gfc_omp_save_and_clear_state, gfc_omp_restore_state): New
+ functions.
+
+2011-01-17 Tobias Burnus <burnus@net-b.de>
+
+ PR fortran/47327
+ * invoke.texi (Options to request or suppress errors
+ and warnings): Fix cross link.
+
2011-01-15 Tobias Burnus <burnus@net-b.de>
* gfortran.texi: Update Fortran 2003 Status section.
diff --git a/gcc/fortran/gfortran.h b/gcc/fortran/gfortran.h
index 2622f22fd85..ebba2a814fb 100644
--- a/gcc/fortran/gfortran.h
+++ b/gcc/fortran/gfortran.h
@@ -2651,11 +2651,14 @@ void gfc_free_case_list (gfc_case *);
gfc_expr *gfc_get_parentheses (gfc_expr *);
/* openmp.c */
+struct gfc_omp_saved_state { void *ptrs[2]; int ints[1]; };
void gfc_free_omp_clauses (gfc_omp_clauses *);
void gfc_resolve_omp_directive (gfc_code *, gfc_namespace *);
void gfc_resolve_do_iterator (gfc_code *, gfc_symbol *);
void gfc_resolve_omp_parallel_blocks (gfc_code *, gfc_namespace *);
void gfc_resolve_omp_do_blocks (gfc_code *, gfc_namespace *);
+void gfc_omp_save_and_clear_state (struct gfc_omp_saved_state *);
+void gfc_omp_restore_state (struct gfc_omp_saved_state *);
/* expr.c */
void gfc_free_actual_arglist (gfc_actual_arglist *);
diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi
index ae11356f834..291d1e7b7c4 100644
--- a/gcc/fortran/invoke.texi
+++ b/gcc/fortran/invoke.texi
@@ -865,7 +865,7 @@ off via @option{-Wno-align-commons}. See also @option{-falign-commons}.
Turns all warnings into errors.
@end table
-@xref{Error and Warning Options,,Options to Request or Suppress Errors and
+@xref{Warning Options,,Options to Request or Suppress Errors and
Warnings, gcc,Using the GNU Compiler Collection (GCC)}, for information on
more options offered by the GBE shared by @command{gfortran}, @command{gcc}
and other GNU compilers.
diff --git a/gcc/fortran/openmp.c b/gcc/fortran/openmp.c
index 6e8182118ce..24e32eb5d04 100644
--- a/gcc/fortran/openmp.c
+++ b/gcc/fortran/openmp.c
@@ -1390,6 +1390,31 @@ gfc_resolve_omp_parallel_blocks (gfc_code *code, gfc_namespace *ns)
}
+/* Save and clear openmp.c private state. */
+
+void
+gfc_omp_save_and_clear_state (struct gfc_omp_saved_state *state)
+{
+ state->ptrs[0] = omp_current_ctx;
+ state->ptrs[1] = omp_current_do_code;
+ state->ints[0] = omp_current_do_collapse;
+ omp_current_ctx = NULL;
+ omp_current_do_code = NULL;
+ omp_current_do_collapse = 0;
+}
+
+
+/* Restore openmp.c private state from the saved state. */
+
+void
+gfc_omp_restore_state (struct gfc_omp_saved_state *state)
+{
+ omp_current_ctx = (struct omp_context *) state->ptrs[0];
+ omp_current_do_code = (gfc_code *) state->ptrs[1];
+ omp_current_do_collapse = state->ints[0];
+}
+
+
/* Note a DO iterator variable. This is special in !$omp parallel
construct, where they are predetermined private. */
diff --git a/gcc/fortran/resolve.c b/gcc/fortran/resolve.c
index a1c991794b0..f2e722320dd 100644
--- a/gcc/fortran/resolve.c
+++ b/gcc/fortran/resolve.c
@@ -2011,11 +2011,14 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
if (!gsym->ns->resolved)
{
gfc_dt_list *old_dt_list;
+ struct gfc_omp_saved_state old_omp_state;
/* Stash away derived types so that the backend_decls do not
get mixed up. */
old_dt_list = gfc_derived_types;
gfc_derived_types = NULL;
+ /* And stash away openmp state. */
+ gfc_omp_save_and_clear_state (&old_omp_state);
gfc_resolve (gsym->ns);
@@ -2025,6 +2028,8 @@ resolve_global_procedure (gfc_symbol *sym, locus *where,
/* Restore the derived types of this namespace. */
gfc_derived_types = old_dt_list;
+ /* And openmp state. */
+ gfc_omp_restore_state (&old_omp_state);
}
/* Make sure that translation for the gsymbol occurs before
@@ -4858,6 +4863,10 @@ expression_rank (gfc_expr *e)
for (ref = e->ref; ref; ref = ref->next)
{
+ if (ref->type == REF_COMPONENT && ref->u.c.component->attr.proc_pointer
+ && ref->u.c.component->attr.function && !ref->next)
+ rank = ref->u.c.component->as ? ref->u.c.component->as->rank : 0;
+
if (ref->type != REF_ARRAY)
continue;
diff --git a/gcc/fortran/trans-expr.c b/gcc/fortran/trans-expr.c
index 42e259354d1..ec1e848509c 100644
--- a/gcc/fortran/trans-expr.c
+++ b/gcc/fortran/trans-expr.c
@@ -3043,8 +3043,9 @@ gfc_conv_procedure_call (gfc_se * se, gfc_symbol * sym,
&& fsym->attr.flavor != FL_PROCEDURE)
|| (fsym->attr.proc_pointer
&& !(e->expr_type == EXPR_VARIABLE
- && e->symtree->n.sym->attr.dummy))
- || (e->expr_type == EXPR_VARIABLE
+ && e->symtree->n.sym->attr.dummy))
+ || (fsym->attr.proc_pointer
+ && e->expr_type == EXPR_VARIABLE
&& gfc_is_proc_ptr_comp (e, NULL))
|| fsym->attr.allocatable))
{