This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC] Fix for autopar


Hi,

Another bug with f951 is that built_in_decls[BUILT_IN_OMP_GET_NUM_THREADS]
is NULL, that produces an ICE in omp-low.c that tries to use it:

  t = build_call_expr (built_in_decls[BUILT_IN_OMP_GET_NUM_THREADS], 0);

For fortran, the omp builtins are initialized conditionally.  The
attached patch initializes these builtins also for autopar.

The patch is not yet tested except on the testcases that I got from
spec2006 that now pass.  I'm just asking for comments.

-- 
Sebastian
AMD - GNU Tools


      * f95-lang.c (gfc_init_builtin_functions): Initialize openMP builtins
      when compiling with -ftree-parallelize-loops.

Index: f95-lang.c
===================================================================
--- f95-lang.c	(revision 131401)
+++ f95-lang.c	(working copy)
@@ -1137,7 +1137,7 @@
 #include "../sync-builtins.def"
 #undef DEF_SYNC_BUILTIN

-  if (gfc_option.flag_openmp)
+  if (gfc_option.flag_openmp || flag_tree_parallelize_loops)
     {
 #undef DEF_GOMP_BUILTIN
 #define DEF_GOMP_BUILTIN(code, name, type, attr) \


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]