aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@gcc.gnu.org>2017-11-01 22:52:21 +0100
committerJakub Jelinek <jakub@gcc.gnu.org>2017-11-01 22:52:21 +0100
commitefc04f78d8a0efb66d9f767ce26aa7d01d19cb0c (patch)
tree8e09ee941e9cc82242b067bfc23517090dff25aa /gcc/testsuite
parentfe1447a1d7ed8945404176fc0941a380682e5f11 (diff)
downloadgcc-efc04f78d8a0efb66d9f767ce26aa7d01d19cb0c.zip
gcc-efc04f78d8a0efb66d9f767ce26aa7d01d19cb0c.tar.gz
gcc-efc04f78d8a0efb66d9f767ce26aa7d01d19cb0c.tar.bz2
re PR rtl-optimization/82778 (crash: insn does not satisfy its constraints)
PR rtl-optimization/82778 PR rtl-optimization/82597 * compare-elim.c (struct comparison): Add in_a_setter field. (find_comparison_dom_walker::before_dom_children): Remove killed bitmap and df_simulate_find_defs call, instead walk the defs. Compute last_setter and initialize in_a_setter. Merge definitions with first initialization for a few variables. (try_validate_parallel): Use insn_invalid_p instead of recog_memoized. Return insn rather than just the pattern. (try_merge_compare): Fix up comment. Don't uselessly test if in_a is a REG_P. Use cmp->in_a_setter instead of walking UD chains. (execute_compare_elim_after_reload): Remove df_chain_add_problem call. * g++.dg/opt/pr82778.C: New test. 2017-11-01 Michael Collison <michael.collison@arm.com> PR rtl-optimization/82597 * gcc.dg/pr82597.c: New test. From-SVN: r254328
Diffstat (limited to 'gcc/testsuite')
-rw-r--r--gcc/testsuite/ChangeLog10
-rw-r--r--gcc/testsuite/g++.dg/opt/pr82778.C37
-rw-r--r--gcc/testsuite/gcc.dg/pr82597.c40
3 files changed, 87 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a8143ad..eba8154 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,13 @@
+2017-11-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/82778
+ * g++.dg/opt/pr82778.C: New test.
+
+2017-11-01 Michael Collison <michael.collison@arm.com>
+
+ PR rtl-optimization/82597
+ * gcc.dg/pr82597.c: New test.
+
2017-11-01 Uros Bizjak <ubizjak@gmail.com>
* gcc.target/alpha/sqrt.c: New test.
diff --git a/gcc/testsuite/g++.dg/opt/pr82778.C b/gcc/testsuite/g++.dg/opt/pr82778.C
new file mode 100644
index 0000000..eeac0c5f
--- /dev/null
+++ b/gcc/testsuite/g++.dg/opt/pr82778.C
@@ -0,0 +1,37 @@
+// PR rtl-optimization/82778
+// { dg-do compile }
+// { dg-options "-O2" }
+
+template <typename a, int b> struct c {
+ typedef a d[b];
+ static a e(d f, int g) { return f[g]; }
+};
+template <typename a, int b> struct B {
+ typedef c<a, b> h;
+ typename h::d i;
+ long j;
+ a at() { return h::e(i, j); }
+};
+int k, m, r, s, t;
+char l, n, q;
+short o, p, w;
+struct C {
+ int u;
+};
+B<C, 4> v;
+void x() {
+ if (((p > (q ? v.at().u : k)) >> l - 226) + !(n ^ r * m))
+ s = ((-(((p > (q ? v.at().u : k)) >> l - 226) + !(n ^ r * m)) < 0) /
+ (-(((p > (q ? v.at().u : k)) >> l - 226) + !(n ^ r * m)) ^
+ -25 & o) &&
+ p) >>
+ (0 <= 0
+ ? 0 ||
+ (-(((p > (q ? v.at().u : k)) >> l - 226) + !(n ^ r * m)) <
+ 0) /
+ (-(((p > (q ? v.at().u : k)) >> l - 226) +
+ !(n ^ r * m)) ^ -25 & o)
+ : 0);
+ w = (p > (q ? v.at().u : k)) >> l - 226;
+ t = !(n ^ r * m);
+}
diff --git a/gcc/testsuite/gcc.dg/pr82597.c b/gcc/testsuite/gcc.dg/pr82597.c
new file mode 100644
index 0000000..98ae264
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr82597.c
@@ -0,0 +1,40 @@
+/* PR rtl-optimization/82597 */
+/* { dg-do compile }*/
+/* { dg-options "-O2 -funroll-loops" } */
+
+int pb;
+
+void
+ch (unsigned char np, char fc)
+{
+ unsigned char *y6 = &np;
+
+ if (fc != 0)
+ {
+ unsigned char *z1 = &np;
+
+ for (;;)
+ if (*y6 != 0)
+ for (fc = 0; fc < 12; ++fc)
+ {
+ int hh;
+ int tp;
+
+ if (fc != 0)
+ hh = (*z1 != 0) ? fc : 0;
+ else
+ hh = pb;
+
+ tp = fc > 0;
+ if (hh == tp)
+ *y6 = 1;
+ }
+ }
+
+ if (np != 0)
+ y6 = (unsigned char *)&fc;
+ if (pb != 0 && *y6 != 0)
+ for (;;)
+ {
+ }
+}