]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR ipa/60026 (ICE at -O3 on valid code (with the optimize pragma) on x86_64-linux...
authorJakub Jelinek <jakub@redhat.com>
Fri, 7 Feb 2014 23:54:17 +0000 (00:54 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Fri, 7 Feb 2014 23:54:17 +0000 (00:54 +0100)
PR ipa/60026
* ipa-cp.c (determine_versionability): Fail at -O0
or __attribute__((optimize (0))) or -fno-ipa-cp functions.
* tree-sra.c (ipa_sra_preliminary_function_checks): Similarly.

Revert:
2014-02-04  Jakub Jelinek  <jakub@redhat.com>

PR ipa/60026
* tree-inline.c (copy_forbidden): Fail for
__attribute__((optimize (0))) functions.

From-SVN: r207621

gcc/ChangeLog
gcc/ipa-cp.c
gcc/tree-inline.c
gcc/tree-sra.c

index b69091eec05344d07ee317f4f4fb791ee19e11d0..9bed95db219b4d8f611e5add884dbcbd59e88d2b 100644 (file)
@@ -1,3 +1,17 @@
+2014-02-08  Jakub Jelinek  <jakub@redhat.com>
+
+       PR ipa/60026
+       * ipa-cp.c (determine_versionability): Fail at -O0
+       or __attribute__((optimize (0))) or -fno-ipa-cp functions.
+       * tree-sra.c (ipa_sra_preliminary_function_checks): Similarly.
+
+       Revert:
+       2014-02-04  Jakub Jelinek  <jakub@redhat.com>
+
+       PR ipa/60026
+       * tree-inline.c (copy_forbidden): Fail for
+       __attribute__((optimize (0))) functions.
+
 2014-02-07  Jan Hubicka  <hubicka@ucw.cz>
 
        * varpool.c: Include pointer-set.h.
index a2682bbe18d49dc2a565c792c53cc0afd405cc57..d93b45c106881379fa45dd1d8c9a471bd9e9104d 100644 (file)
@@ -430,6 +430,9 @@ determine_versionability (struct cgraph_node *node)
     reason = "not a tree_versionable_function";
   else if (cgraph_function_body_availability (node) <= AVAIL_OVERWRITABLE)
     reason = "insufficient body availability";
+  else if (!opt_for_fn (node->decl, optimize)
+          || !opt_for_fn (node->decl, flag_ipa_cp))
+    reason = "non-optimized function";
   else if (lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (node->decl)))
     {
       /* Ideally we should clone the SIMD clones themselves and create
index ade78b22a12aceb5bab23e5652cdfafc76ecc0bc..439ef4c2933a793e76fe387379a081515441e458 100644 (file)
@@ -3315,18 +3315,6 @@ copy_forbidden (struct function *fun, tree fndecl)
        goto fail;
       }
 
-  tree fs_opts;
-  fs_opts = DECL_FUNCTION_SPECIFIC_OPTIMIZATION (fun->decl);
-  if (fs_opts)
-    {
-      struct cl_optimization *os = TREE_OPTIMIZATION (fs_opts);
-      if (!os->x_optimize)
-       {
-         reason = G_("function %q+F compiled without optimizations");
-         goto fail;
-       }
-    }
-
  fail:
   fun->cannot_be_copied_reason = reason;
   fun->cannot_be_copied_set = true;
index 4992b4c13bf4e7615de485ca4a35353b9239e8ae..4071274419f44d386bc7a4e3146efe0dd71dbc00 100644 (file)
@@ -4900,6 +4900,14 @@ ipa_sra_preliminary_function_checks (struct cgraph_node *node)
       return false;
     }
 
+  if (!opt_for_fn (node->decl, optimize)
+      || !opt_for_fn (node->decl, flag_ipa_sra))
+    {
+      if (dump_file)
+       fprintf (dump_file, "Function not optimized.\n");
+      return false;
+    }
+
   if (DECL_VIRTUAL_P (current_function_decl))
     {
       if (dump_file)