]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Make fopenacc an LTO option
authorTom de Vries <tom@codesourcery.com>
Fri, 23 Jan 2015 12:54:16 +0000 (12:54 +0000)
committerTom de Vries <vries@gcc.gnu.org>
Fri, 23 Jan 2015 12:54:16 +0000 (12:54 +0000)
2015-01-23  Tom de Vries  <tom@codesourcery.com>

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

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

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

* testsuite/libgomp.oacc-c-c++-common/abort-5.c: New test.

From-SVN: r220038

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.oacc-c-c++-common/abort-5.c [new file with mode: 0644]

index 418468faf3874f3e16e6194cdffcc38b60e7caf7..b5beaf62153fb804188a566d2e9ed615a1bbe3c4 100644 (file)
@@ -1,3 +1,11 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64672
+       * lto-opts.c (lto_write_options): Output non-explicit conservative
+       -fno-openacc.
+       * lto-wrapper.c (merge_and_complain): Handle merging -fopenacc.
+       (append_compiler_options): Pass -fopenacc through.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64707
index ac72e8681576aeeb71d744b559cdd30e0295ed54..851e664503fc5432a182059c1e97016cd57b8a91 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64672
+       * c.opt (fopenacc): Mark as LTO option.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64707
index 4b92022187fa0f3b0ebad69e739c5d3945bf1ca6..fd004072515280e80cfa7653eb983793a38af616 100644 (file)
@@ -1284,7 +1284,7 @@ ObjC ObjC++ Var(flag_objc1_only)
 Conform to the Objective-C 1.0 language as implemented in GCC 4.0
 
 fopenacc
-C ObjC C++ ObjC++ Var(flag_openacc)
+C ObjC C++ ObjC++ LTO Var(flag_openacc)
 Enable OpenACC
 
 fopenmp
index 5ae81b14a2bf1d4854ea7348a518318be447fffb..bb6635694187da81d7c68f460e9733d629fe16f3 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64672
+       * lang.opt (fopenacc): Mark as LTO option.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64707
index 0360f6c7bad84abc50c8b632930a58a9dd4f0029..d86376a917c99e36a860a61f1fe1547814b990e9 100644 (file)
@@ -567,7 +567,7 @@ Fortran Var(flag_module_private)
 Set default accessibility of module entities to PRIVATE.
 
 fopenacc
-Fortran
+Fortran LTO
 ; Documented in C
 
 fopenmp
index d44dba03935e39e8659015b2817d52937c3574c7..279107fdab32918713acaf8b1f4a3335ac03336a 100644 (file)
@@ -169,6 +169,10 @@ lto_write_options (void)
   if (!global_options_set.x_flag_openmp
       && !global_options.x_flag_openmp)
     append_to_collect_gcc_options (&temporary_obstack, &first_p, "-fno-openmp");
+  if (!global_options_set.x_flag_openacc
+      && !global_options.x_flag_openacc)
+    append_to_collect_gcc_options (&temporary_obstack, &first_p,
+                                  "-fno-openacc");
 
   /* Append options from target hook and store them to offload_lto section.  */
   if (lto_stream_offload_p)
index 2d0d451af86eb4cca1be758a49735621627d04e1..e9507717d4447c25bd87527c3d588d06475c2ee2 100644 (file)
@@ -272,6 +272,7 @@ merge_and_complain (struct cl_decoded_option **decoded_options,
        case OPT_ftrapping_math:
        case OPT_fwrapv:
        case OPT_fopenmp:
+       case OPT_fopenacc:
          /* For selected options we can merge conservatively.  */
          for (j = 0; j < *decoded_options_count; ++j)
            if ((*decoded_options)[j].opt_index == foption->opt_index)
@@ -492,6 +493,7 @@ append_compiler_options (obstack *argv_obstack, struct cl_decoded_option *opts,
        case OPT_ftrapping_math:
        case OPT_fwrapv:
        case OPT_fopenmp:
+       case OPT_fopenacc:
        case OPT_ftrapv:
        case OPT_fstrict_overflow:
        case OPT_foffload_abi_:
index 8c722d4e7bb3d846c93d72bc8efaa341ebf22110..b6dfa23d3cc2d67076d18be4baea3f5a0a09ea20 100644 (file)
@@ -1,3 +1,8 @@
+2015-01-23  Tom de Vries  <tom@codesourcery.com>
+
+       PR libgomp/64672
+       * testsuite/libgomp.oacc-c-c++-common/abort-5.c: New test.
+
 2015-01-23  Tom de Vries  <tom@codesourcery.com>
 
        PR libgomp/64707
diff --git a/libgomp/testsuite/libgomp.oacc-c-c++-common/abort-5.c b/libgomp/testsuite/libgomp.oacc-c-c++-common/abort-5.c
new file mode 100644 (file)
index 0000000..314f04a
--- /dev/null
@@ -0,0 +1,18 @@
+/* { dg-do run } */
+/* { dg-additional-options "-flto" { target lto } } */
+
+#include <stdlib.h>
+
+int
+main (int argc, char **argv)
+{
+
+#pragma acc parallel
+  {
+    if (argc != 1)
+      abort ();
+  }
+
+  return 0;
+}
+