]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* ipa-inline-transform.c (inline_call): Drop -fstrict-aliasing when
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2015 04:19:50 +0000 (04:19 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 1 Dec 2015 04:19:50 +0000 (04:19 +0000)
inlining -fno-strict-aliasing into -fstrict-aliasing body.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@231095 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ipa-inline-transform.c

index 18d1171003146f0253d04df2fdd44cf3b0d6cf9d..0adaff3bde5518d46f49e1227a8145ee3b424b16 100644 (file)
@@ -322,6 +322,21 @@ inline_call (struct cgraph_edge *e, bool update_original,
   if (DECL_FUNCTION_PERSONALITY (callee->decl))
     DECL_FUNCTION_PERSONALITY (to->decl)
       = DECL_FUNCTION_PERSONALITY (callee->decl);
+  if (!opt_for_fn (callee->decl, flag_strict_aliasing)
+      && opt_for_fn (to->decl, flag_strict_aliasing))
+    {
+      struct gcc_options opts = global_options;
+
+      cl_optimization_restore (&opts,
+        TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)));
+      opts.x_flag_strict_aliasing = false;
+      if (dump_file)
+       fprintf (dump_file, "Dropping flag_strict_aliasing on %s:%i\n",
+                to->name (), to->order);
+      build_optimization_node (&opts);
+      DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
+        = build_optimization_node (&opts);
+    }
 
   /* If aliases are involved, redirect edge to the actual destination and
      possibly remove the aliases.  */