From a269531973deae79d2d3aba10ff9eab0fb5df5a9 Mon Sep 17 00:00:00 2001 From: Bill Schmidt Date: Thu, 13 Oct 2016 19:50:41 +0000 Subject: [PATCH] re PR tree-optimization/77937 (ICE: in replace_one_candidate, at gimple-ssa-strength-reduction.c:3370) 2016-10-13 Bill Schmidt PR tree-optimization/77937 * gcc.dg/torture/pr77937-1.c: New. * gcc.dg/torture/pr77937-2.c: New. From-SVN: r241139 --- gcc/testsuite/ChangeLog | 6 ++++++ gcc/testsuite/gcc.dg/torture/pr77937-1.c | 14 ++++++++++++++ gcc/testsuite/gcc.dg/torture/pr77937-2.c | 17 +++++++++++++++++ 3 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/gcc.dg/torture/pr77937-1.c create mode 100644 gcc/testsuite/gcc.dg/torture/pr77937-2.c diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 5e31162e2c6..0960e08ce6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2016-10-13 Bill Schmidt + + PR tree-optimization/77937 + * gcc.dg/torture/pr77937-1.c: New. + * gcc.dg/torture/pr77937-2.c: New. + 2016-10-13 Jakub Jelinek * g++.dg/cpp1z/inline-var1.C: New test. diff --git a/gcc/testsuite/gcc.dg/torture/pr77937-1.c b/gcc/testsuite/gcc.dg/torture/pr77937-1.c new file mode 100644 index 00000000000..5f921fd0606 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr77937-1.c @@ -0,0 +1,14 @@ +/* { dg-do compile } */ +/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */ + +int *a; +int b, c, d; +void fn1(char *p1, int p2) { + int x; + while (1) { + x = 0; + for (; x < 8; x++) + p1[0] = -a[0] * d + p1[0] * c + 1 >> b >> 1; + p1 += p2; + } +} diff --git a/gcc/testsuite/gcc.dg/torture/pr77937-2.c b/gcc/testsuite/gcc.dg/torture/pr77937-2.c new file mode 100644 index 00000000000..1c3dfc1c2d1 --- /dev/null +++ b/gcc/testsuite/gcc.dg/torture/pr77937-2.c @@ -0,0 +1,17 @@ +/* { dg-do compile } */ +/* { dg-do options "-O3 -march=amdfam10" { target { x86_64-*-* } } } */ + +extern int fn2(int); +extern int fn3(int); +int a, b, c; +void fn1(long p1) { + char *d; + for (;; d += p1) { + d[0] = fn2(1 >> a); + fn3(0); + fn3(c >> a); + d[1] = fn3(d[1] * b + c >> a); + d[4] = fn3(d[4] * b + c >> a); + d[5] = fn3(d[5] * b + c >> a); + } +} -- 2.30.2