aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2016-09-22 14:52:09 +0200
committerMartin Liska <marxin@gcc.gnu.org>2016-09-22 12:52:09 +0000
commita13f439f47a1b35ed273bfb34a96e01bb6c9c875 (patch)
tree9891dbd477cab298a615b1c6330961e48b27f24e /gcc/testsuite
parent9ef2eff0d40fb59ee7538148fc8eb25088777297 (diff)
downloadgcc-a13f439f47a1b35ed273bfb34a96e01bb6c9c875.zip
gcc-a13f439f47a1b35ed273bfb34a96e01bb6c9c875.tar.gz
gcc-a13f439f47a1b35ed273bfb34a96e01bb6c9c875.tar.bz2
re PR ipa/77653 (wrong code at -Os and above on x86_64-linux-gnu (in both 32-bit and 64-bit modes))
Fix PR ipa/77653 PR ipa/77653 * gcc.dg/ipa/pr77653.c: New test. PR ipa/77653 * ipa-icf.c (sem_variable::merge): Yield merge operation if alias address matters, not necessarily address of original. From-SVN: r240354
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gcc.dg/ipa/pr77653.c24
2 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 0891121..82a8676 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-09-22 Martin Liska <mliska@suse.cz>
+
+ PR ipa/77653
+ * gcc.dg/ipa/pr77653.c: New test.
+
2016-09-22 Jakub Jelinek <jakub@redhat.com>
PR fortran/77665
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" } } */