* [PATCH] Fix PR ipa/77653
@ 2016-09-22 11:44 Martin Liška
2016-09-22 11:56 ` Richard Biener
0 siblings, 1 reply; 6+ messages in thread
From: Martin Liška @ 2016-09-22 11:44 UTC (permalink / raw)
To: GCC Patches, Richard Biener
[-- Attachment #1: Type: text/plain, Size: 277 bytes --]
Hi.
After some investigation, it shows that IPA ICF merges a pair of variables where
for just one them address matters. Which is obvious error, fixed in attached patch.
Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
Ready to be installed?
Martin
[-- Attachment #2: 0001-Fix-PR-ipa-77653.patch --]
[-- Type: text/x-patch, Size: 2395 bytes --]
From d16301adc382a1cf5ede151993633a2a6d29825f Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Thu, 22 Sep 2016 11:18:49 +0200
Subject: [PATCH] Fix PR ipa/77653
gcc/testsuite/ChangeLog:
2016-09-22 Martin Liska <mliska@suse.cz>
PR ipa/77653
* gcc.dg/ipa/pr77653.c: New test.
gcc/ChangeLog:
2016-09-22 Martin Liska <mliska@suse.cz>
PR ipa/77653
* ipa-icf.c (sem_variable::merge): Yield merge operation if
alias address matters, not necessarily address of original.
---
gcc/ipa-icf.c | 7 ++-----
gcc/testsuite/gcc.dg/ipa/pr77653.c | 24 ++++++++++++++++++++++++
2 files changed, 26 insertions(+), 5 deletions(-)
create mode 100644 gcc/testsuite/gcc.dg/ipa/pr77653.c
diff --git a/gcc/ipa-icf.c b/gcc/ipa-icf.c
index 798d833..0869756 100644
--- a/gcc/ipa-icf.c
+++ b/gcc/ipa-icf.c
@@ -2179,7 +2179,6 @@ sem_variable::merge (sem_item *alias_item)
varpool_node *alias = alias_var->get_node ();
bool original_discardable = false;
- bool original_address_matters = original->address_matters_p ();
bool alias_address_matters = alias->address_matters_p ();
/* See if original is in a section that can be discarded if the main
@@ -2222,13 +2221,11 @@ sem_variable::merge (sem_item *alias_item)
}
/* We can not merge if address comparsion metters. */
- if (original_address_matters && alias_address_matters
- && flag_merge_constants < 2)
+ if (alias_address_matters && flag_merge_constants < 2)
{
if (dump_file)
fprintf (dump_file,
- "Not unifying; "
- "adress of original and alias may be compared.\n\n");
+ "Not unifying; adress of original may be compared.\n\n");
return false;
}
diff --git a/gcc/testsuite/gcc.dg/ipa/pr77653.c b/gcc/testsuite/gcc.dg/ipa/pr77653.c
new file mode 100644
index 0000000..8d11739
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/ipa/pr77653.c
@@ -0,0 +1,24 @@
+/* { dg-options "-O2 -fdump-ipa-icf-details" } */
+
+int a, b, c, d, e, h, i, j, k, l;
+const int f;
+static int g;
+
+void fn1 (int p1)
+{
+ k = d ? c % k : a * b;
+ h &= j ^ i ^ 1;
+}
+
+int main ()
+{
+ const int *m = &f, **n = &m;
+ l && (*n = &e);
+ if (m != &f)
+ __builtin_abort ();
+ fn1 (g);
+ return 0;
+}
+
+/* { dg-final { scan-ipa-dump "Equal symbols: 1" "icf" } } */
+/* { dg-final { scan-ipa-dump "Not unifying; adress of original may be compared." "icf" } } */
--
2.9.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix PR ipa/77653
2016-09-22 11:44 [PATCH] Fix PR ipa/77653 Martin Liška
@ 2016-09-22 11:56 ` Richard Biener
0 siblings, 0 replies; 6+ messages in thread
From: Richard Biener @ 2016-09-22 11:56 UTC (permalink / raw)
To: Martin Liška; +Cc: GCC Patches
On Thu, Sep 22, 2016 at 1:18 PM, Martin Liška <mliska@suse.cz> wrote:
> Hi.
>
> After some investigation, it shows that IPA ICF merges a pair of variables where
> for just one them address matters. Which is obvious error, fixed in attached patch.
>
> Patch can bootstrap on ppc64le-redhat-linux and survives regression tests.
>
> Ready to be installed?
Ok.
Richard.
> Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix PR ipa/77653
2016-09-23 9:22 ` Richard Biener
@ 2016-09-23 10:04 ` Martin Liška
0 siblings, 0 replies; 6+ messages in thread
From: Martin Liška @ 2016-09-23 10:04 UTC (permalink / raw)
To: Richard Biener; +Cc: David Edelsohn, GCC Patches
[-- Attachment #1: Type: text/plain, Size: 211 bytes --]
On 09/23/2016 11:19 AM, Richard Biener wrote:
> Ok, but the classpath ones are imported from upstream (and is going to
> be removed anyway), so please omit those.
>
> Richard.
Good! I installed following.
M.
[-- Attachment #2: 0001-Fix-typos-adress-address.patch --]
[-- Type: text/x-patch, Size: 1169 bytes --]
From 6e23669e0e6572d44939fd0539c438c75c9d381e Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 23 Sep 2016 11:28:23 +0200
Subject: [PATCH] Fix typos: adress -> address
gcc/ChangeLog:
2016-09-23 Martin Liska <mliska@suse.cz>
* config/s390/vx-builtins.md: Replace 'adress' with 'address'.
---
gcc/config/s390/vx-builtins.md | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md
index 444c277..c6ac44c 100644
--- a/gcc/config/s390/vx-builtins.md
+++ b/gcc/config/s390/vx-builtins.md
@@ -389,7 +389,7 @@
; vscef, vsceg
-; A 64 bit target adress generated from 32 bit elements
+; A 64 bit target address generated from 32 bit elements
(define_insn "vec_scatter_elementv4si_DI"
[(set (mem:SI
(plus:DI (zero_extend:DI
@@ -417,7 +417,7 @@
"vsce<V_HW_64:bhfgq>\t%v0,%O2(%v1,%R2),%3"
[(set_attr "op_type" "VRV")])
-; Element size and target adress size is the same
+; Element size and target address size is the same
(define_insn "vec_scatter_element<mode>_<non_vec_int>"
[(set (mem:<non_vec>
(plus:<non_vec_int> (unspec:<non_vec_int>
--
2.9.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix PR ipa/77653
2016-09-23 8:59 ` Martin Liška
@ 2016-09-23 9:22 ` Richard Biener
2016-09-23 10:04 ` Martin Liška
0 siblings, 1 reply; 6+ messages in thread
From: Richard Biener @ 2016-09-23 9:22 UTC (permalink / raw)
To: Martin Liška; +Cc: David Edelsohn, GCC Patches
On Fri, Sep 23, 2016 at 10:51 AM, Martin Liška <mliska@suse.cz> wrote:
> On 09/22/2016 03:07 PM, David Edelsohn wrote:
>> @@ -2222,13 +2221,11 @@ sem_variable::merge (sem_item *alias_item)
>> }
>>
>> /* We can not merge if address comparsion metters. */
>> - if (original_address_matters && alias_address_matters
>> - && flag_merge_constants < 2)
>> + if (alias_address_matters && flag_merge_constants < 2)
>> {
>> if (dump_file)
>> fprintf (dump_file,
>> - "Not unifying; "
>> - "adress of original and alias may be compared.\n\n");
>> + "Not unifying; adress of original may be compared.\n\n");
>> ^^^ address not adress
>> return false;
>> }
>>
>> The dump file message contains a typo: address not adress.
>>
>> +/* { dg-final { scan-ipa-dump "Not unifying; adress of original may
>> be compared." "icf" } } */
>>
>> Similarly, the testcase needs to be updated to match.
>>
>> Thanks, David
>>
>
> Thank you David for the nit, I've installed patch for that as r240399.
> I've also grepped the source code for 'adress' and I found another
> places where we have the typo.
>
> Is the attached patch ready to be installed?
Ok, but the classpath ones are imported from upstream (and is going to
be removed anyway), so please omit those.
Richard.
> Thanks,
> Martin
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix PR ipa/77653
2016-09-22 13:18 David Edelsohn
@ 2016-09-23 8:59 ` Martin Liška
2016-09-23 9:22 ` Richard Biener
0 siblings, 1 reply; 6+ messages in thread
From: Martin Liška @ 2016-09-23 8:59 UTC (permalink / raw)
To: David Edelsohn; +Cc: GCC Patches, Richard Biener
[-- Attachment #1: Type: text/plain, Size: 1080 bytes --]
On 09/22/2016 03:07 PM, David Edelsohn wrote:
> @@ -2222,13 +2221,11 @@ sem_variable::merge (sem_item *alias_item)
> }
>
> /* We can not merge if address comparsion metters. */
> - if (original_address_matters && alias_address_matters
> - && flag_merge_constants < 2)
> + if (alias_address_matters && flag_merge_constants < 2)
> {
> if (dump_file)
> fprintf (dump_file,
> - "Not unifying; "
> - "adress of original and alias may be compared.\n\n");
> + "Not unifying; adress of original may be compared.\n\n");
> ^^^ address not adress
> return false;
> }
>
> The dump file message contains a typo: address not adress.
>
> +/* { dg-final { scan-ipa-dump "Not unifying; adress of original may
> be compared." "icf" } } */
>
> Similarly, the testcase needs to be updated to match.
>
> Thanks, David
>
Thank you David for the nit, I've installed patch for that as r240399.
I've also grepped the source code for 'adress' and I found another
places where we have the typo.
Is the attached patch ready to be installed?
Thanks,
Martin
[-- Attachment #2: 0002-Fix-typos-adress-address.patch --]
[-- Type: text/x-patch, Size: 5467 bytes --]
From 0d9c643c1fa8e3d7fe1b78efaf7c865d6e55f725 Mon Sep 17 00:00:00 2001
From: marxin <mliska@suse.cz>
Date: Fri, 23 Sep 2016 10:42:46 +0200
Subject: [PATCH 2/2] Fix typos: adress -> address
gcc/ChangeLog:
2016-09-23 Martin Liska <mliska@suse.cz>
* config/s390/vx-builtins.md: Replace 'adress' with 'address'.
libjava/classpath/ChangeLog:
2016-09-23 Martin Liska <mliska@suse.cz>
* configure: Replace 'adress' with 'address'.
* java/awt/geom/CubicCurve2D.java: Likewise.
* java/net/Inet6Address.java: Likewise.
* m4/ax_create_stdint_h.m4: Likewise.
* native/jni/native-lib/cpnet.h: Likewise.
---
gcc/config/s390/vx-builtins.md | 4 ++--
libjava/classpath/configure | 2 +-
libjava/classpath/java/awt/geom/CubicCurve2D.java | 2 +-
libjava/classpath/java/net/Inet6Address.java | 2 +-
libjava/classpath/m4/ax_create_stdint_h.m4 | 2 +-
libjava/classpath/native/jni/native-lib/cpnet.h | 2 +-
6 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/gcc/config/s390/vx-builtins.md b/gcc/config/s390/vx-builtins.md
index 444c277..c6ac44c 100644
--- a/gcc/config/s390/vx-builtins.md
+++ b/gcc/config/s390/vx-builtins.md
@@ -389,7 +389,7 @@
; vscef, vsceg
-; A 64 bit target adress generated from 32 bit elements
+; A 64 bit target address generated from 32 bit elements
(define_insn "vec_scatter_elementv4si_DI"
[(set (mem:SI
(plus:DI (zero_extend:DI
@@ -417,7 +417,7 @@
"vsce<V_HW_64:bhfgq>\t%v0,%O2(%v1,%R2),%3"
[(set_attr "op_type" "VRV")])
-; Element size and target adress size is the same
+; Element size and target address size is the same
(define_insn "vec_scatter_element<mode>_<non_vec_int>"
[(set (mem:<non_vec>
(plus:<non_vec_int> (unspec:<non_vec_int>
diff --git a/libjava/classpath/configure b/libjava/classpath/configure
index 6d46403..f554860 100755
--- a/libjava/classpath/configure
+++ b/libjava/classpath/configure
@@ -28939,7 +28939,7 @@ typedef u_int32_t uint32_t;
#endif
#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
+/* we must guess all the basic types. Apart from byte-addressable system, */
/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
/* (btw, those nibble-addressable systems are way off, or so we assume) */
diff --git a/libjava/classpath/java/awt/geom/CubicCurve2D.java b/libjava/classpath/java/awt/geom/CubicCurve2D.java
index 5cb11fe..1fc2619 100644
--- a/libjava/classpath/java/awt/geom/CubicCurve2D.java
+++ b/libjava/classpath/java/awt/geom/CubicCurve2D.java
@@ -1040,7 +1040,7 @@ public abstract class CubicCurve2D implements Shape, Cloneable
* Detailed in an article on Eric Haines' page:
* http://www.acm.org/tog/editors/erich/ptinpoly/
*
- * A special-case not adressed in this code is self-intersections
+ * A special-case not addressed in this code is self-intersections
* of the curve, e.g. if the axis intersects the self-itersection,
* the degenerate roots of the polynomial will erroneously count as
* a single intersection of the curve, and not two.
diff --git a/libjava/classpath/java/net/Inet6Address.java b/libjava/classpath/java/net/Inet6Address.java
index 60c4065..7ce3a87 100644
--- a/libjava/classpath/java/net/Inet6Address.java
+++ b/libjava/classpath/java/net/Inet6Address.java
@@ -299,7 +299,7 @@ public final class Inet6Address extends InetAddress
}
/**
- * Returns the scope ID of the address scope if it is a scoped adress using
+ * Returns the scope ID of the address scope if it is a scoped address using
* an integer to identify the scope.
*
* Otherwise this method returns 0.
diff --git a/libjava/classpath/m4/ax_create_stdint_h.m4 b/libjava/classpath/m4/ax_create_stdint_h.m4
index 453af07..2c58e54 100644
--- a/libjava/classpath/m4/ax_create_stdint_h.m4
+++ b/libjava/classpath/m4/ax_create_stdint_h.m4
@@ -430,7 +430,7 @@ typedef u_int32_t uint32_t;
#endif
#ifdef _STDINT_NEED_INT_MODEL_T
-/* we must guess all the basic types. Apart from byte-adressable system, */
+/* we must guess all the basic types. Apart from byte-addressable system, */
/* there a few 32-bit-only dsp-systems that we guard with BYTE_MODEL 8-} */
/* (btw, those nibble-addressable systems are way off, or so we assume) */
diff --git a/libjava/classpath/native/jni/native-lib/cpnet.h b/libjava/classpath/native/jni/native-lib/cpnet.h
index 979c363..a24d114 100644
--- a/libjava/classpath/native/jni/native-lib/cpnet.h
+++ b/libjava/classpath/native/jni/native-lib/cpnet.h
@@ -98,7 +98,7 @@ JNIEXPORT jint cpnet_addMembership (JNIEnv *env, jint fd, cpnet_address *addr);
JNIEXPORT jint cpnet_dropMembership (JNIEnv *env, jint fd, cpnet_address *addr);
JNIEXPORT jint cpnet_getAvailableBytes (JNIEnv *env, jint fd, jint *availableBytes);
JNIEXPORT jint cpnet_getHostname (JNIEnv *env, char *hostname, jint hostname_len);
-JNIEXPORT jint cpnet_getHostByName (JNIEnv *env, const char *hostname, cpnet_address ***adresses, jint *addresses_count);
+JNIEXPORT jint cpnet_getHostByName (JNIEnv *env, const char *hostname, cpnet_address ***addresses, jint *addresses_count);
JNIEXPORT jint cpnet_getHostByAddr (JNIEnv *env, cpnet_address *addr, char *hostname, jint hostname_len);
JNIEXPORT jint cpnet_aton (JNIEnv *env, const char *hostname, cpnet_address **addr);
JNIEXPORT void cpnet_freeAddresses(JNIEnv * env, cpnet_address **addr, jint addresses_count);
--
2.9.2
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] Fix PR ipa/77653
@ 2016-09-22 13:18 David Edelsohn
2016-09-23 8:59 ` Martin Liška
0 siblings, 1 reply; 6+ messages in thread
From: David Edelsohn @ 2016-09-22 13:18 UTC (permalink / raw)
To: Martin Liška; +Cc: GCC Patches, Richard Biener
@@ -2222,13 +2221,11 @@ sem_variable::merge (sem_item *alias_item)
}
/* We can not merge if address comparsion metters. */
- if (original_address_matters && alias_address_matters
- && flag_merge_constants < 2)
+ if (alias_address_matters && flag_merge_constants < 2)
{
if (dump_file)
fprintf (dump_file,
- "Not unifying; "
- "adress of original and alias may be compared.\n\n");
+ "Not unifying; adress of original may be compared.\n\n");
^^^ address not adress
return false;
}
The dump file message contains a typo: address not adress.
+/* { dg-final { scan-ipa-dump "Not unifying; adress of original may
be compared." "icf" } } */
Similarly, the testcase needs to be updated to match.
Thanks, David
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-09-23 9:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-09-22 11:44 [PATCH] Fix PR ipa/77653 Martin Liška
2016-09-22 11:56 ` Richard Biener
2016-09-22 13:18 David Edelsohn
2016-09-23 8:59 ` Martin Liška
2016-09-23 9:22 ` Richard Biener
2016-09-23 10:04 ` Martin Liška
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).