aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2017-06-02 10:07:15 +0200
committerJakub Jelinek <jakub@gcc.gnu.org>2017-06-02 10:07:15 +0200
commit74b4885d944854e7a8c032cb169a5c6f4d6e4058 (patch)
tree64697b0e19af803724a7e99715567fa79b97793d /gcc
parentaad16012aa3bd5fe1c019bac5dc1c71537c5431c (diff)
downloadgcc-74b4885d944854e7a8c032cb169a5c6f4d6e4058.zip
gcc-74b4885d944854e7a8c032cb169a5c6f4d6e4058.tar.gz
gcc-74b4885d944854e7a8c032cb169a5c6f4d6e4058.tar.bz2
re PR rtl-optimization/80903 (ICE: internal consistency failure (error: invalid rtl sharing found in the insn))
PR rtl-optimization/80903 * loop-doloop.c (add_test): Unshare sequence. * gcc.dg/pr80903.c: New test. From-SVN: r248815
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/loop-doloop.c1
-rw-r--r--gcc/testsuite/ChangeLog3
-rw-r--r--gcc/testsuite/gcc.dg/pr80903.c34
4 files changed, 43 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 3700ebc..f44c2b8 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,8 @@
+2017-06-02 Jakub Jelinek <jakub@redhat.com>
+
+ PR rtl-optimization/80903
+ * loop-doloop.c (add_test): Unshare sequence.
+
2017-06-02 Bernd Edlinger <bernd.edlinger@hotmail.de>
* doc/invoke.texi: Document the -Wsizeof-pointer-div warning.
diff --git a/gcc/loop-doloop.c b/gcc/loop-doloop.c
index 3483000..c018e2c 100644
--- a/gcc/loop-doloop.c
+++ b/gcc/loop-doloop.c
@@ -367,6 +367,7 @@ add_test (rtx cond, edge *e, basic_block dest)
}
seq = get_insns ();
+ unshare_all_rtl_in_chain (seq);
end_sequence ();
/* There always is at least the jump insn in the sequence. */
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index a111f2b..dc6cdcd 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,8 @@
2017-06-02 Jakub Jelinek <jakub@redhat.com>
+ PR rtl-optimization/80903
+ * gcc.dg/pr80903.c: New test.
+
PR fortran/80918
* gfortran.dg/gomp/pr80918.f90: New test.
diff --git a/gcc/testsuite/gcc.dg/pr80903.c b/gcc/testsuite/gcc.dg/pr80903.c
new file mode 100644
index 0000000..73d44b0
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/pr80903.c
@@ -0,0 +1,34 @@
+/* PR rtl-optimization/80903 */
+/* { dg-do compile } */
+/* { dg-options "-O3 -funroll-loops" } */
+
+short int a;
+
+void
+foo (int x, short int y, short int z)
+{
+ if (y != 0)
+ {
+ const short int b = 37;
+ y = 0;
+ while (y < b)
+ {
+ while (y < b)
+ {
+ lab:
+ ++y;
+ }
+ for (y = 0; y < b - 1; ++y)
+ ;
+ if (z != 0)
+ {
+ --a;
+ y *= a;
+ }
+ z = x;
+ }
+ x = 0;
+ }
+
+ goto lab;
+}