+2017-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * graphite-scop-detection.c (scop_detection::build_scop_breadth):
+ Check all loops contained in the merged region.
+
2017-02-07 Andrew Pinski <apinski@cavium.com>
* config/aarch64/aarch64.md (popcount<mode>2): New pattern.
sese_l combined = merge_sese (s1, s2);
- if (combined
- && loop_is_valid_in_scop (loop, combined)
- && loop_is_valid_in_scop (loop->next, combined))
+ /* Combining adjacent loops may add unrelated loops into the
+ region so we have to check all sub-loops of the outer loop
+ that are in the combined region. */
+ if (combined)
+ for (l = loop_outer (loop)->inner; l; l = l->next)
+ if (bb_in_sese_p (l->header, combined)
+ && ! loop_is_valid_in_scop (l, combined))
+ {
+ combined = invalid_sese;
+ break;
+ }
+
+ if (combined)
s1 = combined;
else
add_scop (s2);
+2017-02-08 Richard Biener <rguenther@suse.de>
+
+ PR tree-optimization/71824
+ * gcc.dg/graphite/pr71824-2.c: New testcase.
+
2017-02-07 Andrew Pinski <apinski@cavium.com>
* gcc.target/aarch64/popcount.c : New Testcase.
--- /dev/null
+/* { dg-do compile } */
+/* { dg-options "-O2 -floop-nest-optimize" } */
+
+typedef struct { float x1; } bx;
+typedef struct {
+ int w;
+ short o;
+} T2P;
+T2P a;
+int b;
+void fn2();
+void fn3(bx*,short);
+void fn1() {
+ unsigned i = 0;
+ int c;
+ bx *d;
+ bx **h;
+ if (b == 0) {
+ fn2();
+ return;
+ }
+ for (; c; c++)
+ for (; i < 100; i++) {
+ d = h[i];
+ d->x1 = a.w;
+ }
+ for (; i < 100; i++) {
+ d = h[i];
+ d->x1 = a.w;
+ }
+ if (a.o)
+ for (; b;)
+ fn3(d, a.o);
+}