aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClaudiu Zissulescu <claziss@synopsys.com>2017-11-30 15:42:01 +0100
committerClaudiu Zissulescu <claziss@gcc.gnu.org>2017-11-30 15:42:01 +0100
commit5d4c34aaade8422c8289daa8a5c95fab7830de37 (patch)
tree8c5aac5e60a55af7cbc47ecbba0fa629ed417b7e
parent31e72f4f37b9ed02cd5e28a30c7c4b46b96ac913 (diff)
downloadgcc-5d4c34aaade8422c8289daa8a5c95fab7830de37.zip
gcc-5d4c34aaade8422c8289daa8a5c95fab7830de37.tar.gz
gcc-5d4c34aaade8422c8289daa8a5c95fab7830de37.tar.bz2
[ARC] Update uses for hw-loop labels.
Make sure we mark the hw-loop labels as beeing used. gcc/ 2017-09-19 Claudiu Zissulescu <claziss@synopsys.com> * config/arc/arc.c (hwloop_optimize): Update hw-loop's end/start labels number of usages. gcc/testsuite 2017-09-19 Claudiu Zissulescu <claziss@synopsys.com> * gcc.target/arc/loop-2.cpp: New test. From-SVN: r255274
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/config/arc/arc.c3
-rw-r--r--gcc/testsuite/ChangeLog4
-rw-r--r--gcc/testsuite/gcc.target/arc/loop-2.cpp18
4 files changed, 30 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ddcd983..9454909 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,10 @@
2017-11-30 Claudiu Zissulescu <claziss@synopsys.com>
+ * config/arc/arc.c (hwloop_optimize): Update hw-loop's end/start
+ labels number of usages.
+
+2017-11-30 Claudiu Zissulescu <claziss@synopsys.com>
+
* config/arc/arc.c (arc_cannot_substitue_mem_equiv_p): New
function.
(TARGET_CANNOT_SUBSTITUTE_MEM_EQUIV_P): Define.
diff --git a/gcc/config/arc/arc.c b/gcc/config/arc/arc.c
index e739d60..57ea502 100644
--- a/gcc/config/arc/arc.c
+++ b/gcc/config/arc/arc.c
@@ -7501,6 +7501,9 @@ hwloop_optimize (hwloop_info loop)
/* Insert the loop end label before the last instruction of the
loop. */
emit_label_after (end_label, loop->last_insn);
+ /* Make sure we mark the begining and end label as used. */
+ LABEL_NUSES (loop->end_label)++;
+ LABEL_NUSES (loop->start_label)++;
return true;
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f12d075..1b5359d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,9 @@
2017-11-30 Claudiu Zissulescu <claziss@synopsys.com>
+ * gcc.target/arc/loop-2.cpp: New test.
+
+2017-11-30 Claudiu Zissulescu <claziss@synopsys.com>
+
* gcc.target/arc/lra-1.c: New test.
2017-11-30 Will Schmidt <will_schmidt@vnet.ibm.com>
diff --git a/gcc/testsuite/gcc.target/arc/loop-2.cpp b/gcc/testsuite/gcc.target/arc/loop-2.cpp
new file mode 100644
index 0000000..d1dc917
--- /dev/null
+++ b/gcc/testsuite/gcc.target/arc/loop-2.cpp
@@ -0,0 +1,18 @@
+/* { dg-options "-O2" } *
+/* { dg-do assemble } */
+
+/* This file fails to assemble if we forgot to increase the number of
+ uses for loop's start and end labels. */
+int a, c, d;
+int *b;
+void fn1(int p1) {
+ if (d == 5)
+ for (int i; i < p1; ++i)
+ if (c)
+ b[i] = c;
+ else
+ int t = a = t;
+ else
+ for (int i; i < p1; ++i)
+ b[i] = 0;
+}