Hi,

this is a regression present on the mainline and 5 branch.  For the attached 
Fortran testcase, the GIMPLE verifier stops the compiler on an error mark 
inserted by omp-low.c:omp_copy_decl for a FRAME variable created during the 
nested function lowering pass because it is not marked as shared since it is 
created too late (it is created at the end of the pass when optimization is 
disabled after the change for PR debug/53927).

Fixed by teaching convert_local_omp_clauses about this case, tested on x86_64-
suse-linux, OK for the mainline and 5 branch?


2015-06-26  Eric Botcazou  <ebotca...@adacore.com>

        PR middle-end/66633
        * tree-nested.c (convert_local_omp_clauses): Initialize need_frame to
        true if not optimizing.


2015-06-26  Eric Botcazou  <ebotca...@adacore.com>

        * gfortran.dg/pr66633.f90: New test.


-- 
Eric Botcazou
Index: tree-nested.c
===================================================================
--- tree-nested.c	(revision 224993)
+++ tree-nested.c	(working copy)
@@ -1697,7 +1697,9 @@ static bool
 convert_local_omp_clauses (tree *pclauses, struct walk_stmt_info *wi)
 {
   struct nesting_info *const info = (struct nesting_info *) wi->info;
-  bool need_frame = false, need_stmts = false;
+  /* If not optimizing, we will force the creation of the FRAME object in
+     convert_all_function_calls, so we need to take it into account here.  */
+  bool need_frame = !optimize, need_stmts = false;
   tree clause, decl;
   int dummy;
   bitmap new_suppress;
! PR middle-end/66633
! Testcase by Andrew Benson <abenso...@gmail.com>

! { dg-do compile }
! { dg-options "-fopenmp" }
! { dg-require-effective-target fopenmp }

module spls
contains
  function spl()
    !$omp parallel
    write (0,*) igrt(fli)
    !$omp end parallel
  contains
    double precision function fli()
    end function fli
  end function spl
end module spls

Reply via email to