Commit 06f97084 by Jakub Jelinek Committed by Jakub Jelinek

re PR tree-optimization/83293 (ICE: in gsi_insert_seq_nodes_after, at gimple-iterator.c:278)

	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.

	* g++.dg/torture/pr83293.C: New test.

From-SVN: r255451
parent bf8ce85a
2017-12-06 Jakub Jelinek <jakub@redhat.com> 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 PR sanitizer/81281
* match.pd ((T)(P + A) - (T)P -> (T) A): Split into separate * match.pd ((T)(P + A) - (T)P -> (T) A): Split into separate
simplify for plus with :c added, and pointer_plus without that. simplify for plus with :c added, and pointer_plus without that.
...@@ -3418,7 +3418,7 @@ insert_initializers (slsr_cand_t c) ...@@ -3418,7 +3418,7 @@ insert_initializers (slsr_cand_t c)
gsi_insert_after (&gsi, cast_stmt, GSI_NEW_STMT); gsi_insert_after (&gsi, cast_stmt, GSI_NEW_STMT);
gimple_set_location (cast_stmt, loc); 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)); gimple_set_location (init_stmt, gimple_location (basis_stmt));
......
2017-12-06 Jakub Jelinek <jakub@redhat.com> 2017-12-06 Jakub Jelinek <jakub@redhat.com>
PR tree-optimization/83293
* g++.dg/torture/pr83293.C: New test.
PR sanitizer/81281 PR sanitizer/81281
* gcc.c-torture/execute/pr81281.c: New test. * gcc.c-torture/execute/pr81281.c: New test.
* gcc.dg/pr81281-1.c: New test. * gcc.dg/pr81281-1.c: New test.
......
// 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;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment