* tree-ssa-address.c (gen_addr_rtx): Don't handle index if it
is const0_rtx.
* gcc.dg/
20161219.c: New test.
From-SVN: r244219
+2017-01-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * tree-ssa-address.c (gen_addr_rtx): Don't handle index if it
+ is const0_rtx.
+
2017-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/78997
+2017-01-09 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
+
+ * gcc.dg/20161219.c: New test.
+
2017-01-09 Richard Biener <rguenther@suse.de>
PR tree-optimization/78997
--- /dev/null
+/* { dg-do assemble } */
+/* { dg-options "-O1 -w" } */
+
+static long long a[9];
+int b, c, d, e, g;
+
+static int
+fn1 (int *p1)
+{
+ b = 1;
+ for (; b >= 0; b--)
+ {
+ d = 0;
+ for (;; d++)
+ {
+ e && (a[d] = 0);
+ if (*p1)
+ break;
+ c = (int) a;
+ }
+ }
+ return 0;
+}
+
+int
+main ()
+{
+ int f = fn1 ((int *) f);
+ return f;
+}
if (offset_p)
*offset_p = NULL;
- if (index)
+ if (index && index != const0_rtx)
{
act_elem = index;
if (step)