aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/ipa-pure-const.c
diff options
context:
space:
mode:
authorBen Cheng <bccheng@google.com>2014-04-22 13:33:12 -0700
committerBen Cheng <bccheng@google.com>2014-04-22 13:33:12 -0700
commite3cc64dec20832769406aa38cde83c7dd4194bf4 (patch)
treeef8e39be37cfe0cb69d850043b7924389ff17164 /gcc-4.9/gcc/ipa-pure-const.c
parentf33c7b3122b1d7950efa88067c9a156229ba647b (diff)
downloadtoolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.gz
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.tar.bz2
toolchain_gcc-e3cc64dec20832769406aa38cde83c7dd4194bf4.zip
[4.9] GCC 4.9.0 official release refresh
Change-Id: Ic99a7da8b44b789a48aeec93b33e93944d6e6767
Diffstat (limited to 'gcc-4.9/gcc/ipa-pure-const.c')
-rw-r--r--gcc-4.9/gcc/ipa-pure-const.c72
1 files changed, 41 insertions, 31 deletions
diff --git a/gcc-4.9/gcc/ipa-pure-const.c b/gcc-4.9/gcc/ipa-pure-const.c
index 296f9c07b..7d3588099 100644
--- a/gcc-4.9/gcc/ipa-pure-const.c
+++ b/gcc-4.9/gcc/ipa-pure-const.c
@@ -1327,35 +1327,39 @@ propagate_pure_const (void)
w_l->pure_const_state = this_state;
w_l->looping = this_looping;
- switch (this_state)
- {
- case IPA_CONST:
- if (!TREE_READONLY (w->decl))
- {
- warn_function_const (w->decl, !this_looping);
- if (dump_file)
- fprintf (dump_file, "Function found to be %sconst: %s\n",
- this_looping ? "looping " : "",
- w->name ());
- }
- cgraph_set_const_flag (w, true, this_looping);
- break;
+ /* Inline clones share declaration with their offline copies;
+ do not modify their declarations since the offline copy may
+ be different. */
+ if (!w->global.inlined_to)
+ switch (this_state)
+ {
+ case IPA_CONST:
+ if (!TREE_READONLY (w->decl))
+ {
+ warn_function_const (w->decl, !this_looping);
+ if (dump_file)
+ fprintf (dump_file, "Function found to be %sconst: %s\n",
+ this_looping ? "looping " : "",
+ w->name ());
+ }
+ cgraph_set_const_flag (w, true, this_looping);
+ break;
- case IPA_PURE:
- if (!DECL_PURE_P (w->decl))
- {
- warn_function_pure (w->decl, !this_looping);
- if (dump_file)
- fprintf (dump_file, "Function found to be %spure: %s\n",
- this_looping ? "looping " : "",
- w->name ());
- }
- cgraph_set_pure_flag (w, true, this_looping);
- break;
+ case IPA_PURE:
+ if (!DECL_PURE_P (w->decl))
+ {
+ warn_function_pure (w->decl, !this_looping);
+ if (dump_file)
+ fprintf (dump_file, "Function found to be %spure: %s\n",
+ this_looping ? "looping " : "",
+ w->name ());
+ }
+ cgraph_set_pure_flag (w, true, this_looping);
+ break;
- default:
- break;
- }
+ default:
+ break;
+ }
w_info = (struct ipa_dfs_info *) w->aux;
w = w_info->next_cycle;
}
@@ -1448,10 +1452,16 @@ propagate_nothrow (void)
funct_state w_l = get_function_state (w);
if (!can_throw && !TREE_NOTHROW (w->decl))
{
- cgraph_set_nothrow_flag (w, true);
- if (dump_file)
- fprintf (dump_file, "Function found to be nothrow: %s\n",
- w->name ());
+ /* Inline clones share declaration with their offline copies;
+ do not modify their declarations since the offline copy may
+ be different. */
+ if (!w->global.inlined_to)
+ {
+ cgraph_set_nothrow_flag (w, true);
+ if (dump_file)
+ fprintf (dump_file, "Function found to be nothrow: %s\n",
+ w->name ());
+ }
}
else if (can_throw && !TREE_NOTHROW (w->decl))
w_l->can_throw = true;