Commit 4dd0ef27 by Jeff Law Committed by Jeff Law

re PR tree-optimization/59322 (ICE with segfault on valid code at -O1, -O2, and…

re PR tree-optimization/59322 (ICE with segfault on valid code at -O1, -O2, and -O3 on x86_64-linux-gnu)

	PR tree-optimization/59322
	* tree-ssa-threadedge.c (create_edge_and_update_destination_phis):
	Remove code which copied jump threading paths.

	PR tree-optimization/59322
	* gcc.c-torture/compile/pr59322.c: New test

From-SVN: r205617
parent 80f1fd0d
2013-12-02 Jeff Law <law@redhat.com>
PR tree-optimization/59322
* tree-ssa-threadedge.c (create_edge_and_update_destination_phis):
Remove code which copied jump threading paths.
2013-12-02 Sriraman Tallam <tmsriram@google.com> 2013-12-02 Sriraman Tallam <tmsriram@google.com>
PR target/58944 PR target/58944
2013-12-02 Jeff Law <law@redhat.com>
PR tree-optimization/59322
* gcc.c-torture/compile/pr59322.c: New test
2013-12-02 Sriraman Tallam <tmsriram@google.com> 2013-12-02 Sriraman Tallam <tmsriram@google.com>
PR target/58944 PR target/58944
......
int a, b, d;
short c;
int
foo ()
{
for (b = 0; b; b = a)
for (c = 18; c < 10; c++)
{
d = c;
if (d)
return 0;
}
return 0;
}
...@@ -421,27 +421,22 @@ create_edge_and_update_destination_phis (struct redirection_data *rd, ...@@ -421,27 +421,22 @@ create_edge_and_update_destination_phis (struct redirection_data *rd,
e->probability = REG_BR_PROB_BASE; e->probability = REG_BR_PROB_BASE;
e->count = bb->count; e->count = bb->count;
/* We have to copy path -- which means creating a new vector as well /* We used to copy the thread path here. That was added in 2007
as all the jump_thread_edge entries. */ and dutifully updated through the representation changes in 2013.
if (rd->path->last ()->e->aux)
{
vec<jump_thread_edge *> *path = THREAD_PATH (rd->path->last ()->e);
vec<jump_thread_edge *> *copy = new vec<jump_thread_edge *> ();
/* Sadly, the elements of the vector are pointers and need to In 2013 we added code to thread from an interior node through
be copied as well. */ the backedge to another interior node. That runs after the code
for (unsigned int i = 0; i < path->length (); i++) to thread through loop headers from outside the loop.
{
jump_thread_edge *x The latter may delete edges in the CFG, including those
= new jump_thread_edge ((*path)[i]->e, (*path)[i]->type); which appeared in the jump threading path we copied here. Thus
copy->safe_push (x); we'd end up using a dangling pointer.
}
e->aux = (void *)copy; After reviewing the 2007/2011 code, I can't see how anything
} depended on copying the AUX field and clearly copying the jump
else threading path is problematical due to embedded edge pointers.
{ It has been removed. */
e->aux = NULL; e->aux = NULL;
}
/* If there are any PHI nodes at the destination of the outgoing edge /* If there are any PHI nodes at the destination of the outgoing edge
from the duplicate block, then we will need to add a new argument from the duplicate block, then we will need to add a new argument
......
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