From 9f54bf9c6f018c60c634be0521119b8727efffeb Mon Sep 17 00:00:00 2001 From: Chen Gang Date: Mon, 12 Jan 2015 09:02:33 +0000 Subject: [PATCH] re PR ipa/64550 (IPA fixes cause ICE in tree-ssa.c:939) PR ipa/64550 PR ipa/64551 PR ipa/64552 * ipa-icf.c (sem_function::equals_private): Use '&&' instead of '||' to fix typo issue. * gcc/tree.h (target_opts_for_fn): Check NULL_TREE since it can accept and return NULL. From-SVN: r219449 --- gcc/ChangeLog | 11 +++++++++++ gcc/ipa-icf.c | 2 +- gcc/tree.h | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 1abad52e9c2..6c592a79a9a 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,14 @@ +2015-01-12 Chen Gang + + PR ipa/64550 + PR ipa/64551 + PR ipa/64552 + * ipa-icf.c (sem_function::equals_private): Use '&&' instead of + '||' to fix typo issue. + + * gcc/tree.h (target_opts_for_fn): Check NULL_TREE since it can + accept and return NULL. + 2015-01-12 Martin Liska * cgraph.c (cgraph_edge::remove_callee): Move function to header diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c index 1b76a1df372..4ccaf8cb90f 100644 --- a/gcc/ipa-icf.c +++ b/gcc/ipa-icf.c @@ -438,7 +438,7 @@ sem_function::equals_private (sem_item *item, cl_target_option *tar1 = target_opts_for_fn (decl); cl_target_option *tar2 = target_opts_for_fn (m_compared_func->decl); - if (tar1 != NULL || tar2 != NULL) + if (tar1 != NULL && tar2 != NULL) { if (!cl_target_option_eq (tar1, tar2)) { diff --git a/gcc/tree.h b/gcc/tree.h index fc8c8fe5a90..ac2726811fa 100644 --- a/gcc/tree.h +++ b/gcc/tree.h @@ -4640,7 +4640,7 @@ 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); + return fn_opts == NULL_TREE ? NULL : TREE_TARGET_OPTION (fn_opts); } /* opt flag for function FNDECL, e.g. opts_for_fn (fndecl, optimize) is -- 2.30.2