diff mbox series

GCC 11 backports

Message ID 9581571d-08e1-576b-d53a-90a0fd3ce516@suse.cz
State New
Headers show
Series GCC 11 backports | expand

Commit Message

Martin Liška Aug. 16, 2021, 11:13 a.m. UTC
I'm going to apply the following 3 tested patches.

Martin

Comments

Martin Liška Aug. 23, 2021, 8:54 a.m. UTC | #1
On 8/16/21 13:13, Martin Liška wrote:
> I'm going to apply the following 3 tested patches.
> 
> Martin

One more patch I've just tested.

Martin
Martin Liška Nov. 5, 2021, 4:08 p.m. UTC | #2
On 8/23/21 10:54, Martin Liška wrote:
> On 8/16/21 13:13, Martin Liška wrote:
>> I'm going to apply the following 3 tested patches.
>>
>> Martin
> 
> One more patch I've just tested.
> 
> Martin

And one more backport.

Martin
Martin Liška Nov. 8, 2021, 12:26 p.m. UTC | #3
On 11/5/21 17:08, Martin Liška wrote:
> On 8/23/21 10:54, Martin Liška wrote:
>> On 8/16/21 13:13, Martin Liška wrote:
>>> I'm going to apply the following 3 tested patches.
>>>
>>> Martin
>>
>> One more patch I've just tested.
>>
>> Martin
> 
> And one more backport.
> 
> Martin

One more tested patch.

Martin
Martin Liška Dec. 16, 2021, 11:46 a.m. UTC | #4
On 11/8/21 13:26, Martin Liška wrote:
> On 11/5/21 17:08, Martin Liška wrote:
>> On 8/23/21 10:54, Martin Liška wrote:
>>> On 8/16/21 13:13, Martin Liška wrote:
>>>> I'm going to apply the following 3 tested patches.
>>>>
>>>> Martin
>>>
>>> One more patch I've just tested.
>>>
>>> Martin
>>
>> And one more backport.
>>
>> Martin
> 
> One more tested patch.
> 
> Martin

And one more tested patch.

Martin
Martin Liška Jan. 18, 2022, 1:26 p.m. UTC | #5
On 12/16/21 12:46, Martin Liška wrote:
> On 11/8/21 13:26, Martin Liška wrote:
>> On 11/5/21 17:08, Martin Liška wrote:
>>> On 8/23/21 10:54, Martin Liška wrote:
>>>> On 8/16/21 13:13, Martin Liška wrote:
>>>>> I'm going to apply the following 3 tested patches.
>>>>>
>>>>> Martin
>>>>
>>>> One more patch I've just tested.
>>>>
>>>> Martin
>>>
>>> And one more backport.
>>>
>>> Martin
>>
>> One more tested patch.
>>
>> Martin
> 
> And one more tested patch.
> 
> Martin

One more patch.

Martin
diff mbox series

Patch

From 5b1bcb10b2cc6c93b06d22da0a044a6a6f362f0b Mon Sep 17 00:00:00 2001
From: Martin Liska <mliska@suse.cz>
Date: Fri, 13 Aug 2021 12:35:47 +0200
Subject: [PATCH 3/3] ipa: ICF should check SSA_NAME_IS_DEFAULT_DEF

	PR ipa/100600

gcc/ChangeLog:

	* ipa-icf-gimple.c (func_checker::compare_ssa_name): Do not
	  consider equal SSA_NAMEs when one is a param.

gcc/testsuite/ChangeLog:

	* gcc.dg/ipa/pr100600.c: New test.
---
 gcc/ipa-icf-gimple.c                |  3 +++
 gcc/testsuite/gcc.dg/ipa/pr100600.c | 22 ++++++++++++++++++++++
 2 files changed, 25 insertions(+)
 create mode 100644 gcc/testsuite/gcc.dg/ipa/pr100600.c

diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c
index edf5f025627..cf0262621be 100644
--- a/gcc/ipa-icf-gimple.c
+++ b/gcc/ipa-icf-gimple.c
@@ -96,6 +96,9 @@  func_checker::compare_ssa_name (const_tree t1, const_tree t2)
   unsigned i1 = SSA_NAME_VERSION (t1);
   unsigned i2 = SSA_NAME_VERSION (t2);
 
+  if (SSA_NAME_IS_DEFAULT_DEF (t1) != SSA_NAME_IS_DEFAULT_DEF (t2))
+    return false;
+
   if (m_source_ssa_names[i1] == -1)
     m_source_ssa_names[i1] = i2;
   else if (m_source_ssa_names[i1] != (int) i2)
diff --git a/gcc/testsuite/gcc.dg/ipa/pr100600.c b/gcc/testsuite/gcc.dg/ipa/pr100600.c
new file mode 100644
index 00000000000..8a3d0e16e7e
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr100600.c
@@ -0,0 +1,22 @@ 
+/* PR ipa/100600 */
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+int a, b, c;
+long d(long x, long e, long f, long g) {
+  long h, i;
+  for (; h < e; h++) {
+    i = f;
+    for (; i < g; i++)
+      c = b + a;
+  }
+  return h + i;
+}
+
+long j(long x, long e, long y, long g) {
+  long h, i;
+  for (; h < e; h++)
+    for (; i < g; i++)
+      c = b + a;
+  return h + i;
+}
-- 
2.32.0