aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree.h
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2015-01-09 11:33:00 +0100
committerMartin Liska <marxin@gcc.gnu.org>2015-01-09 10:33:00 +0000
commit3f9f4ae70554ee0f7b756fc1d811aefb6e70f076 (patch)
tree1c877e5ceb75376cc425d2d78971a217c753a79c /gcc/tree.h
parent56f6033d2bc75b90a1006b5245a8da338224506d (diff)
downloadgcc-3f9f4ae70554ee0f7b756fc1d811aefb6e70f076.zip
gcc-3f9f4ae70554ee0f7b756fc1d811aefb6e70f076.tar.gz
gcc-3f9f4ae70554ee0f7b756fc1d811aefb6e70f076.tar.bz2
IPA ICF: target and optimization flags comparison.
* cgraphunit.c (cgraph_node::create_wrapper): Fix level of indentation. * ipa-icf.c (sem_function::equals_private): Add support for target and (sem_item_optimizer::merge_classes): Remove redundant function optimization flags comparison. * tree.h (target_opts_for_fn): New function. * gcc.dg/ipa/ipa-icf-32.c: New test. From-SVN: r219377
Diffstat (limited to 'gcc/tree.h')
-rw-r--r--gcc/tree.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/gcc/tree.h b/gcc/tree.h
index 3e74c7e..e9af9bf 100644
--- a/gcc/tree.h
+++ b/gcc/tree.h
@@ -4671,6 +4671,16 @@ opts_for_fn (const_tree fndecl)
return TREE_OPTIMIZATION (fn_opts);
}
+/* Return pointer to target flags of FNDECL. */
+static inline cl_target_option *
+target_opts_for_fn (const_tree fndecl)
+{
+ tree fn_opts = DECL_FUNCTION_SPECIFIC_TARGET (fndecl);
+ if (fn_opts == NULL_TREE)
+ fn_opts = target_option_default_node;
+ return TREE_TARGET_OPTION (fn_opts);
+}
+
/* opt flag for function FNDECL, e.g. opts_for_fn (fndecl, optimize) is
the optimization level of function fndecl. */
#define opt_for_fn(fndecl, opt) (opts_for_fn (fndecl)->x_##opt)