diff mbox

Fix 2 typos in IPA ICF pass

Message ID bf7282e3-16c1-2952-7ea8-a76274086f91@suse.cz
State New
Headers show

Commit Message

Martin Liška Oct. 25, 2016, 11:37 a.m. UTC
Hi.

Simple fix for a typo in IPA ICF. It cant' cause a regression as cl_target_option_eq
function is called in equals_wpa function.

Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

Ready to be installed?
Martin

Comments

Richard Biener Oct. 25, 2016, noon UTC | #1
On Tue, Oct 25, 2016 at 1:37 PM, Martin Liška <mliska@suse.cz> wrote:
> Hi.

>

> Simple fix for a typo in IPA ICF. It cant' cause a regression as cl_target_option_eq

> function is called in equals_wpa function.

>

> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.

>

> Ready to be installed?


Ok.

Richard.

> Martin
diff mbox

Patch

From e4f9f913c32109a2773145870333ae88fc9cdae2 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Tue, 25 Oct 2016 09:57:55 +0200
Subject: [PATCH] Fix 2 typos in IPA ICF pass

gcc/testsuite/ChangeLog:

2016-10-25  Martin Liska  <mliska@suse.cz>

	* gcc.dg/ipa/ipa-icf-32.c: Removed one scanned pattern.

gcc/ChangeLog:

2016-10-25  H.J. Lu  <hongjiu.lu@intel.com>
	    Martin Liska  <mliska@suse.cz>

	PR ipa/78099
	* common.opt: Mark flag_ipa_icf_variables as Optimization flag.
	* ipa-icf.c (sem_function::get_hash): Add target optimization
	node to hash.
---
 gcc/common.opt                        | 2 +-
 gcc/ipa-icf.c                         | 1 +
 gcc/testsuite/gcc.dg/ipa/ipa-icf-32.c | 1 -
 3 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/common.opt b/gcc/common.opt
index 6f24f56..729cbd8 100644
--- a/gcc/common.opt
+++ b/gcc/common.opt
@@ -1597,7 +1597,7 @@  Common Report Var(flag_ipa_icf_functions) Optimization
 Perform Identical Code Folding for functions.
 
 fipa-icf-variables
-Common Report Var(flag_ipa_icf_variables)
+Common Report Var(flag_ipa_icf_variables) Optimization
 Perform Identical Code Folding for variables.
 
 fipa-reference
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 3886fa6..e8880cb 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -300,6 +300,7 @@  sem_function::get_hash (void)
 	 (cl_target_option_hash
 	   (TREE_TARGET_OPTION (DECL_FUNCTION_SPECIFIC_TARGET (decl))));
       if (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl))
+	hstate.add_wide_int
 	 (cl_optimization_hash
 	   (TREE_OPTIMIZATION (DECL_FUNCTION_SPECIFIC_OPTIMIZATION (decl))));
       hstate.add_flag (DECL_CXX_CONSTRUCTOR_P (decl));
diff --git a/gcc/testsuite/gcc.dg/ipa/ipa-icf-32.c b/gcc/testsuite/gcc.dg/ipa/ipa-icf-32.c
index 9f42918..df11ac5 100644
--- a/gcc/testsuite/gcc.dg/ipa/ipa-icf-32.c
+++ b/gcc/testsuite/gcc.dg/ipa/ipa-icf-32.c
@@ -19,5 +19,4 @@  int main()
   return foo (0) + bar (0);
 }
 
-/* { dg-final { scan-ipa-dump "optimization flags are different" "icf"  } } */
 /* { dg-final { scan-ipa-dump "Equal symbols: 0" "icf"  } } */
-- 
2.10.1