aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJan Hubicka <hubicka@ucw.cz>2015-04-22 03:32:14 +0200
committerJan Hubicka <hubicka@gcc.gnu.org>2015-04-22 01:32:14 +0000
commit5a33401eabe208e602a94bbb1921ec1b19b1f185 (patch)
tree0cf6448d2193e3d8eab8d2eca4091ff512fb348d /gcc
parent6e37129a8d084acccf4f1ae345def97fe9a6f0d5 (diff)
downloadgcc-5a33401eabe208e602a94bbb1921ec1b19b1f185.zip
gcc-5a33401eabe208e602a94bbb1921ec1b19b1f185.tar.gz
gcc-5a33401eabe208e602a94bbb1921ec1b19b1f185.tar.bz2
re PR ipa/65076 (16% tramp3d-v4.cpp compile time regression)
PR ipa/65076 * passes.def (early_optimizations): Add pass_dse. * g++.dg/tree-ssa/pr61034.C: Update template. * g++.dg/warn/Warray-bounds.C: Harden for DSE. * gcc.dg/Warray-bounds-11.c: Likewise. * gcc.dg/Warray-bounds.c: Likewise. From-SVN: r222305
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/passes.def1
-rw-r--r--gcc/testsuite/ChangeLog8
-rw-r--r--gcc/testsuite/g++.dg/tree-ssa/pr61034.C2
-rw-r--r--gcc/testsuite/g++.dg/warn/Warray-bounds.C6
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds-11.c6
-rw-r--r--gcc/testsuite/gcc.dg/Warray-bounds.c8
7 files changed, 35 insertions, 1 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 64a7b4b..6959c06 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2015-04-21 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65076
+ * passes.def (early_optimizations): Add pass_dse.
+
2015-04-21 Trevor Saunders <tbsaunde+gcc@tbsaunde.org>
* defaults.h (INSN_REFERENCES_ARE_DELAYED): New definition.
diff --git a/gcc/passes.def b/gcc/passes.def
index ffa63b5..4c20cdf 100644
--- a/gcc/passes.def
+++ b/gcc/passes.def
@@ -89,6 +89,7 @@ along with GCC; see the file COPYING3. If not see
NEXT_PASS (pass_build_ealias);
NEXT_PASS (pass_fre);
NEXT_PASS (pass_merge_phi);
+ NEXT_PASS (pass_dse);
NEXT_PASS (pass_cd_dce);
NEXT_PASS (pass_early_ipa_sra);
NEXT_PASS (pass_tail_recursion);
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index c8f4aeb..8b2b177 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,11 @@
+2015-04-21 Jan Hubicka <hubicka@ucw.cz>
+
+ PR ipa/65076
+ * g++.dg/tree-ssa/pr61034.C: Update template.
+ * g++.dg/warn/Warray-bounds.C: Harden for DSE.
+ * gcc.dg/Warray-bounds-11.c: Likewise.
+ * gcc.dg/Warray-bounds.c: Likewise.
+
2015-04-21 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR libgfortran/65234
diff --git a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C
index 9ec3995..91e694e 100644
--- a/gcc/testsuite/g++.dg/tree-ssa/pr61034.C
+++ b/gcc/testsuite/g++.dg/tree-ssa/pr61034.C
@@ -42,6 +42,6 @@ bool f(I a, I b, I c, I d) {
// This works only if everything is inlined into 'f'.
// { dg-final { scan-tree-dump-times ";; Function" 1 "fre2" } }
-// { dg-final { scan-tree-dump-times "free" 19 "fre2" } }
+// { dg-final { scan-tree-dump-times "free" 18 "fre2" } }
// { dg-final { scan-tree-dump-times "unreachable" 11 "fre2" } }
// { dg-final { cleanup-tree-dump "fre2" } }
diff --git a/gcc/testsuite/g++.dg/warn/Warray-bounds.C b/gcc/testsuite/g++.dg/warn/Warray-bounds.C
index 61c7c5d..574e9de 100644
--- a/gcc/testsuite/g++.dg/warn/Warray-bounds.C
+++ b/gcc/testsuite/g++.dg/warn/Warray-bounds.C
@@ -11,6 +11,7 @@ static inline int n(void) {
void g(int *p);
void h(int p);
+void bar (void *);
int* f(void) {
int b[10];
@@ -27,6 +28,7 @@ int* f(void) {
a[ 9] = 0;
a[10] = 0; /* { dg-warning "array subscript" } */
a[11] = 0; /* { dg-warning "array subscript" } */
+ bar (a);
a[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
a[2 * n() - 10] = 1;
a[2 * n() - 1] = 1;
@@ -38,6 +40,7 @@ int* f(void) {
b[ 9] = 0;
b[10] = 0; /* { dg-warning "array subscript" } */
b[11] = 0; /* { dg-warning "array subscript" } */
+ bar (b);
b[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
b[2 * n() - 10] = 1;
b[2 * n() - 1] = 1;
@@ -49,6 +52,7 @@ int* f(void) {
c.c[ 9] = 0;
c.c[10] = 0; /* { dg-warning "array subscript" } */
c.c[11] = 0; /* { dg-warning "array subscript" } */
+ bar (&c);
c.c[2 * n() - 11] = 1; /* { dg-warning "array subscript" } */
c.c[2 * n() - 10] = 1;
c.c[2 * n() - 1] = 1;
@@ -87,6 +91,8 @@ int* f(void) {
if (-1 >= 0)
c.c[-1] = 0;
+ bar (b);
+ bar (&c);
return a;
}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds-11.c b/gcc/testsuite/gcc.dg/Warray-bounds-11.c
index 2e68498..92e92c0 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds-11.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds-11.c
@@ -92,5 +92,11 @@ void foo(int (*a)[3])
bar(c);
bar(e);
bar(f.f);
+ bar(h1->j);
+ bar(h3->j);
+ bar(h3b->j);
+ bar(h1b->j);
+ bar(h->j);
+ bar(h0->j);
}
diff --git a/gcc/testsuite/gcc.dg/Warray-bounds.c b/gcc/testsuite/gcc.dg/Warray-bounds.c
index aa154a7..925f562 100644
--- a/gcc/testsuite/gcc.dg/Warray-bounds.c
+++ b/gcc/testsuite/gcc.dg/Warray-bounds.c
@@ -11,6 +11,8 @@ static inline int n(void) {
void g(int *p);
void h(int p);
+void bar (void *);
+
int* f(void) {
int b[10];
int i;
@@ -26,10 +28,12 @@ int* f(void) {
a[ 9] = 0;
a[10] = 0; /* { dg-warning "6:array subscript" } */
a[11] = 0; /* { dg-warning "6:array subscript" } */
+ bar (a);
a[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */
a[2 * n() - 10] = 1;
a[2 * n() - 1] = 1;
a[2 * n() - 0] = 1; /* { dg-warning "6:array subscript" } */
+ bar (a);
b[-1] = 0; /* { dg-warning "6:array subscript" } */
b[ 0] = 0;
@@ -37,6 +41,7 @@ int* f(void) {
b[ 9] = 0;
b[10] = 0; /* { dg-warning "6:array subscript" } */
b[11] = 0; /* { dg-warning "6:array subscript" } */
+ bar (b);
b[2 * n() - 11] = 1; /* { dg-warning "6:array subscript" } */
b[2 * n() - 10] = 1;
b[2 * n() - 1] = 1;
@@ -48,6 +53,7 @@ int* f(void) {
c.c[ 9] = 0;
c.c[10] = 0; /* { dg-warning "8:array subscript" } */
c.c[11] = 0; /* { dg-warning "8:array subscript" } */
+ bar (&c);
c.c[2 * n() - 11] = 1; /* { dg-warning "8:array subscript" } */
c.c[2 * n() - 10] = 1;
c.c[2 * n() - 1] = 1;
@@ -88,6 +94,8 @@ int* f(void) {
for (i = 20; i < 30; ++i)
a[i] = 1; /* { dg-warning "15:array subscript" } */
+ bar (b);
+ bar (&c);
return a;
}