aboutsummaryrefslogtreecommitdiff
path: root/gcc/ipa-inline-transform.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2017-01-13 13:56:54 +0100
committerMartin Liska <marxin@gcc.gnu.org>2017-01-13 12:56:54 +0000
commit77719b0675a248bcf9cb0876a86e80ca54979601 (patch)
treeee2c1eda6fcc5175948e6466e036b6bf04e1ee12 /gcc/ipa-inline-transform.c
parentb1c95bb595d159b769409063df40414b9c830009 (diff)
downloadgcc-77719b0675a248bcf9cb0876a86e80ca54979601.zip
gcc-77719b0675a248bcf9cb0876a86e80ca54979601.tar.gz
gcc-77719b0675a248bcf9cb0876a86e80ca54979601.tar.bz2
Reload global options when strict aliasing is dropped (PR ipa/79043).
2017-01-13 Martin Liska <mliska@suse.cz> PR ipa/79043 * function.c (set_cfun): Add new argument force. * function.h (set_cfun): Likewise. * ipa-inline-transform.c (inline_call): Use the function when strict alising from is dropped for function we inline to. 2017-01-13 Martin Liska <mliska@suse.cz> PR ipa/79043 * gcc.c-torture/execute/pr79043.c: New test. From-SVN: r244435
Diffstat (limited to 'gcc/ipa-inline-transform.c')
-rw-r--r--gcc/ipa-inline-transform.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/gcc/ipa-inline-transform.c b/gcc/ipa-inline-transform.c
index 7725fad..a8e73cd 100644
--- a/gcc/ipa-inline-transform.c
+++ b/gcc/ipa-inline-transform.c
@@ -340,6 +340,8 @@ 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);
+
+ bool reload_optimization_node = false;
if (!opt_for_fn (callee->decl, flag_strict_aliasing)
&& opt_for_fn (to->decl, flag_strict_aliasing))
{
@@ -352,6 +354,7 @@ inline_call (struct cgraph_edge *e, bool update_original,
to->name (), to->order);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
+ reload_optimization_node = true;
}
inline_summary *caller_info = inline_summaries->get (to);
@@ -412,9 +415,14 @@ inline_call (struct cgraph_edge *e, bool update_original,
callee->name (), callee->order, to->name (), to->order);
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
+ reload_optimization_node = true;
}
}
+ /* Reload global optimization flags. */
+ if (reload_optimization_node && DECL_STRUCT_FUNCTION (to->decl) == cfun)
+ set_cfun (cfun, true);
+
/* If aliases are involved, redirect edge to the actual destination and
possibly remove the aliases. */
if (e->callee != callee)