2017-12-06 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/83293
+ * gimple-ssa-strength-reduction.c (insert_initializers): Use
+ GSI_NEW_STMT instead of GSI_SAME_STMT in gsi_insert_after that
+ might insert into empty bb.
+
PR sanitizer/81281
* match.pd ((T)(P + A) - (T)P -> (T) A): Split into separate
simplify for plus with :c added, and pointer_plus without that.
gsi_insert_after (&gsi, cast_stmt, GSI_NEW_STMT);
gimple_set_location (cast_stmt, loc);
}
- gsi_insert_after (&gsi, init_stmt, GSI_SAME_STMT);
+ gsi_insert_after (&gsi, init_stmt, GSI_NEW_STMT);
}
gimple_set_location (init_stmt, gimple_location (basis_stmt));
2017-12-06 Jakub Jelinek <jakub@redhat.com>
+ PR tree-optimization/83293
+ * g++.dg/torture/pr83293.C: New test.
+
PR sanitizer/81281
* gcc.c-torture/execute/pr81281.c: New test.
* gcc.dg/pr81281-1.c: New test.
--- /dev/null
+// PR tree-optimization/83293
+
+typedef __SIZE_TYPE__ size_t;
+template <typename T, typename> struct A {
+ T a;
+ A (T x) : a(x) {}
+ T foo () { return a; }
+};
+
+template <typename T, typename U, typename V>
+int
+operator==(A<T, V> x, A<U, V> p2)
+{
+ return x.foo () == p2.foo ();
+}
+
+struct B { struct { int *b, *c; } d; };
+struct C : B {
+ A<int *, int> bar () { return d.b; }
+ A<int *, int> baz () { return d.c; }
+ size_t boo () { return d.c - d.b; }
+ int zoo () { return bar () == baz (); }
+};
+struct D { C e; } a;
+size_t b;
+
+size_t
+test (int x)
+{
+ size_t c (x * b);
+ if (!a.e.zoo ())
+ {
+ x += 2;
+ for (size_t d = 0, e = a.e.boo (); d < e; ++d)
+ c += test (0);
+ }
+ c += (x - 1) * b;
+ return c;
+}