diff options
author | Janus Weil <janus@gcc.gnu.org> | 2009-12-29 20:29:54 +0100 |
---|---|---|
committer | Janus Weil <janus@gcc.gnu.org> | 2009-12-29 20:29:54 +0100 |
commit | 8b5f6dd83d7887c725337c83f302279946767212 (patch) | |
tree | b8a7ce2370b53aced3f62718aa0e0488a351fd11 | |
parent | af6ffd394adde39a33d4f652bf4e53d4a2f2baea (diff) | |
download | gcc-8b5f6dd83d7887c725337c83f302279946767212.zip gcc-8b5f6dd83d7887c725337c83f302279946767212.tar.gz gcc-8b5f6dd83d7887c725337c83f302279946767212.tar.bz2 |
re PR fortran/42517 (-fcheck=recursion does not work with -fopenmp)
gcc/fortran/
2009-12-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/42517
* invoke.texi: Document the interference of
-fcheck=recursion and -fopenmp.
* trans-decl.c (gfc_generate_function_code): Disable -fcheck=recursion
when used with -fopenmp.
gcc/testsuite/
2009-12-29 Janus Weil <janus@gcc.gnu.org>
PR fortran/42517
* gfortran.dg/gomp/recursion1.f90: New test.
From-SVN: r155506
-rw-r--r-- | gcc/fortran/ChangeLog | 16 | ||||
-rw-r--r-- | gcc/fortran/invoke.texi | 2 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gfortran.dg/gomp/recursion1.f90 | 27 |
5 files changed, 52 insertions, 7 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 55fc753..43d206a 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,4 +1,12 @@ -2009-12-28 Janus Weil <janus@gcc.gnu.org> +2009-12-29 Janus Weil <janus@gcc.gnu.org> + + PR fortran/42517 + * invoke.texi: Document the interference of + -fcheck=recursion and -fopenmp. + * trans-decl.c (gfc_generate_function_code): Disable -fcheck=recursion + when used with -fopenmp. + +2009-12-28 Janus Weil <janus@gcc.gnu.org> PR fortran/42353 * symbol.c (gfc_find_derived_vtab): Make vtabs and vtypes private. @@ -14,7 +22,7 @@ explicitly declared if requested by the new flag. * invoke.texi: Document new flag -Wimplicit-procedure. -2009-12-17 Janus Weil <janus@gcc.gnu.org> +2009-12-17 Janus Weil <janus@gcc.gnu.org> PR fortran/42144 * trans-expr.c (select_class_proc): Skip abstract base types. @@ -39,7 +47,7 @@ PR fortran/42354 * expr.c (check_init_expr): Do not check for specification functions. -2009-12-11 Janus Weil <janus@gcc.gnu.org> +2009-12-11 Janus Weil <janus@gcc.gnu.org> PR fortran/42257 * module.c (write_dt_extensions): Check for accessibility. @@ -54,7 +62,7 @@ conversion. * gfortran.h gfc_type_convert_binary): Adjusted prototype. -2009-12-11 Janus Weil <janus@gcc.gnu.org> +2009-12-11 Janus Weil <janus@gcc.gnu.org> PR fortran/42335 * symbol.c (select_type_insert_tmp): Add an extra check for diff --git a/gcc/fortran/invoke.texi b/gcc/fortran/invoke.texi index 2485e37..b9ad170 100644 --- a/gcc/fortran/invoke.texi +++ b/gcc/fortran/invoke.texi @@ -1257,6 +1257,8 @@ Enable generation of run-time checks for pointers and allocatables. @item @samp{recursion} Enable generation of run-time checks for recursively called subroutines and functions which are not marked as recursive. See also @option{-frecursive}. +Note: This check does not work for OpenMP programs and is disabled if used +together with @option{-fopenmp}. @end table diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 2e3fedd..9a01dba 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -4318,7 +4318,8 @@ gfc_generate_function_code (gfc_namespace * ns) is_recursive = sym->attr.recursive || (sym->attr.entry_master && sym->ns->entries->sym->attr.recursive); - if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive) + if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive + && !gfc_option.flag_openmp) { char * msg; @@ -4395,7 +4396,8 @@ gfc_generate_function_code (gfc_namespace * ns) gfc_add_expr_to_block (&block, tmp); /* Reset recursion-check variable. */ - if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive) + if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive + && !gfc_option.flag_openmp) { gfc_add_modify (&block, recurcheckvar, boolean_false_node); recurcheckvar = NULL; @@ -4426,7 +4428,8 @@ gfc_generate_function_code (gfc_namespace * ns) { gfc_add_expr_to_block (&block, tmp); /* Reset recursion-check variable. */ - if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive) + if ((gfc_option.rtcheck & GFC_RTCHECK_RECURSION) && !is_recursive + && !gfc_option.flag_openmp) { gfc_add_modify (&block, recurcheckvar, boolean_false_node); recurcheckvar = NULL; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 7705d82..8be8a06 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-12-29 Janus Weil <janus@gcc.gnu.org> + + PR fortran/42517 + * gfortran.dg/gomp/recursion1.f90: New test. + 2009-12-29 Eric Botcazou <ebotcazou@adacore.com> * gnat.dg/test_raise_from_pure.adb: XFAIL for the ARM. diff --git a/gcc/testsuite/gfortran.dg/gomp/recursion1.f90 b/gcc/testsuite/gfortran.dg/gomp/recursion1.f90 new file mode 100644 index 0000000..0b7b271 --- /dev/null +++ b/gcc/testsuite/gfortran.dg/gomp/recursion1.f90 @@ -0,0 +1,27 @@ +! { dg-do run } +! { dg-options "-fopenmp -fcheck=recursion" } +! +! PR 42517: Bogus runtime error with -fopenmp -fcheck=recursion +! +! Contributed by Janus Weil <janus@gcc.gnu.org> + +implicit none +integer :: i,s + +s=0 +!$omp parallel do private(i) shared(s) +do i=1,10 + call sub(i) +end do +!$omp end parallel do +if (s/=55) call abort() + +contains + + subroutine sub (n) + integer :: n + s = s + n + print '(A,i3)',"loop =",n + end subroutine + +end |