Make fopenmp an LTO option
authorTom de Vries <tom@codesourcery.com>
Fri, 23 Jan 2015 12:53:55 +0000 (12:53 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 23 Jan 2015 12:53:55 +0000 (12:53 +0000)
2015-01-23  Tom de Vries  <tom@codesourcery.com>

PR libgomp/64707
* lto-opts.c (lto_write_options): Output non-explicit conservative
-fno-openmp.
* lto-wrapper.c (merge_and_complain): Handle merging -fopenmp.
(append_compiler_options): Pass -fopenmp through.

* c.opt (fopenmp): Mark as LTO option.

* lang.opt (fopenmp): Mark as LTO option.

* testsuite/libgomp.c/target-9.c: Add -ftree-parallelize-loops=0 to
dg-options.

From-SVN: r220037

gcc/ChangeLog
gcc/c-family/ChangeLog
gcc/c-family/c.opt
gcc/fortran/ChangeLog
gcc/fortran/lang.opt
gcc/lto-opts.c
gcc/lto-wrapper.c
libgomp/ChangeLog
libgomp/testsuite/libgomp.c/target-9.c

index f74a495838e6333a8fcc2d3aac3d13f0a5b9466f..418468faf3874f3e16e6194cdffcc38b60e7caf7 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64707
+       * lto-opts.c (lto_write_options): Output non-explicit conservative
+       -fno-openmp.
+       * lto-wrapper.c (merge_and_complain): Handle merging -fopenmp.
+       (append_compiler_options): Pass -fopenmp through.
+
 2015-01-23  Jakub Jelinek  <jakub@redhat.com>
 
        PR debug/64511
index 62b8c3403f941a4ca888cdb525a9d2f6915d4b5c..ac72e8681576aeeb71d744b559cdd30e0295ed54 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64707
+       * c.opt (fopenmp): Mark as LTO option.
+
 2015-01-21  Jakub Jelinek  <jakub@redhat.com>
 
        PR c/63307
index 62b6c68576d94d3cc59457be5f526a28169ecac3..4b92022187fa0f3b0ebad69e739c5d3945bf1ca6 100644 (file)
@@ -1288,7 +1288,7 @@ C ObjC C++ ObjC++ Var(flag_openacc)
 Enable OpenACC
 
 fopenmp
-C ObjC C++ ObjC++ Var(flag_openmp)
+C ObjC C++ ObjC++ LTO Var(flag_openmp)
 Enable OpenMP (implies -frecursive in Fortran)
 
 fopenmp-simd
index 6e17a653be5c788b8b5bc25a7e183d013c95f78c..5ae81b14a2bf1d4854ea7348a518318be447fffb 100644 (file)
@@ -1,3 +1,7 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64707
+       * lang.opt (fopenmp): Mark as LTO option.
 
 2015-01-23  Andre Vehreschild  <vehre@gmx.de>
 
index a7a4ed644f5a766fd7e361f56478d4823a2db8df..0360f6c7bad84abc50c8b632930a58a9dd4f0029 100644 (file)
@@ -571,7 +571,7 @@ Fortran
 ; Documented in C
 
 fopenmp
-Fortran
+Fortran LTO
 ; Documented in C
 
 fopenmp-simd
index 026b323b46f66558028c68c65f64a724253c6ca5..d44dba03935e39e8659015b2817d52937c3574c7 100644 (file)
@@ -166,6 +166,10 @@ lto_write_options (void)
     append_to_collect_gcc_options (&temporary_obstack, &first_p,
                               "-fno-strict-overflow");
 
+  if (!global_options_set.x_flag_openmp
+      && !global_options.x_flag_openmp)
+    append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fno-openmp");
+
   /* Append options from target hook and store them to offload_lto section.  */
   if (lto_stream_offload_p)
     {
index b1efed2f9c255d5d88c33b1210d8bdcc680587a7..2d0d451af86eb4cca1be758a49735621627d04e1 100644 (file)
@@ -271,6 +271,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
        case OPT_fsigned_zeros:
        case OPT_ftrapping_math:
        case OPT_fwrapv:
+       case OPT_fopenmp:
          /* For selected options we can merge conservatively.  */
          for (j = 0; j < *decoded_options_count; ++j)
            if ((*decoded_options)[j].opt_index == foption->opt_index)
@@ -490,6 +491,7 @@ append_compiler_options (obstack *argv_obstack, struct cl_decoded_option *opts,
        case OPT_fsigned_zeros:
        case OPT_ftrapping_math:
        case OPT_fwrapv:
+       case OPT_fopenmp:
        case OPT_ftrapv:
        case OPT_fstrict_overflow:
        case OPT_foffload_abi_:
index 7e866ac1070c1d5207e006890cadfba2b478247a..8c722d4e7bb3d846c93d72bc8efaa341ebf22110 100644 (file)
@@ -1,3 +1,9 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64707
+       * testsuite/libgomp.c/target-9.c: Add -ftree-parallelize-loops=0 to
+       dg-options.
+
 2015-01-19  Thomas Schwinge  <thomas@codesourcery.com>
 
        PR libgomp/64625
index 00fe0cb170298fb0d9b975093991eede77a9bc31..4f3c812afd0d785910e4a4cbf644ad3c1f3415ca 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O1" } */
+/* { dg-options "-O1 -ftree-parallelize-loops=0" } */
 /* { dg-additional-options "-flto" { target lto } } */
 
 #include <stdlib.h>