+2017-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
+ Guy Benyei <guybe@mellanox.com>
+
+ * config/arc/arc.c (arc_reorg): Move loop_end_id into a more local
+ block, and do not negate it, the stored id is already negative.
+
2017-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
* config/arc/arc.md (doloop_begin_i): Use @pcl assembler syntax.
rtx_insn *lp_simple = NULL;
rtx_insn *next = NULL;
rtx op0 = XEXP (XVECEXP (PATTERN (insn), 0, 1), 0);
- HOST_WIDE_INT loop_end_id
- = -INTVAL (XEXP (XVECEXP (PATTERN (insn), 0, 4), 0));
int seen_label = 0;
for (lp = prev;
if (!lp || !NONJUMP_INSN_P (lp)
|| dead_or_set_regno_p (lp, LP_COUNT))
{
+ HOST_WIDE_INT loop_end_id
+ = INTVAL (XEXP (XVECEXP (PATTERN (insn), 0, 4), 0));
+
for (prev = next = insn, lp = NULL ; prev || next;)
{
if (prev)
+2017-04-14 Andrew Burgess <andrew.burgess@embecosm.com>
+
+ * gcc.target/arc/loop-1.c: New file.
+
2017-04-14 Michael Meissner <meissner@linux.vnet.ibm.com>
PR target/80098
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2" } */
+
+/* This case would fail to make use of the zero-overhead loop
+ instruction at one time due to a bug. */
+
+extern char a[];
+
+struct some_t
+{
+ struct
+ {
+ int aaa;
+ short bbb;
+ char ccc;
+ char ddd;
+ } ppp[8];
+
+ int www[1];
+};
+
+int b;
+
+void
+some_function ()
+{
+ struct some_t *tmp = (struct some_t *) a;
+
+ while ((*tmp).ppp[b].ccc)
+ while(0);
+
+ for (; b; b++)
+ {
+ if (tmp->ppp[b].ccc)
+ {
+ int c = tmp->ppp[b].bbb;
+ int d = tmp->ppp[b].aaa;
+ int e = d - tmp->www[c];
+ if (e)
+ tmp->ppp[b].ddd = 1;
+ }
+ }
+}
+
+/* { dg-final { scan-assembler "\[^\n\]+lp \\.L__GCC__" } } */