re PR tree-optimization/59221 (wrong code at -O2 and -O3 on x86_64-linux-gnu)

PR tree-optimization/59221
	* tree-ssa-threadedge.c (thread_across_edge): Properly manage
	temporary equivalences when threading through joiner blocks.

	PR tree-optimization/59221
	* gcc.c-torture/execute/pr59221.c: New test.

From-SVN: r205229
This commit is contained in:
Jeff Law 2013-11-21 12:45:16 -07:00 committed by Jeff Law
parent 3c8e8595ed
commit a609470572
4 changed files with 37 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2013-11-21 Jeff Law <law@redhat.com>
PR tree-optimization/59221
* tree-ssa-threadedge.c (thread_across_edge): Properly manage
temporary equivalences when threading through joiner blocks.
2013-11-21 Joseph Myers <joseph@codesourcery.com> 2013-11-21 Joseph Myers <joseph@codesourcery.com>
PR rtl-optimization/55950 PR rtl-optimization/55950

View File

@ -1,3 +1,8 @@
2013-11-21 Jeff Law <law@redhat.com>
PR tree-optimization/59221
* gcc.c-torture/execute/pr59221.c: New test.
2013-11-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 2013-11-21 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR libfortran/59227 PR libfortran/59227

View File

@ -0,0 +1,19 @@
int a = 1, b, d;
short e;
int
main ()
{
for (; b; b++)
;
short f = a;
int g = 15;
e = f ? f : 1 << g;
int h = e;
d = h == 83647 ? 0 : h;
if (d != 1)
__builtin_abort ();
return 0;
}

View File

@ -1072,6 +1072,10 @@ thread_across_edge (gimple dummy_cond,
/* Look at each successor of E->dest to see if we can thread through it. */ /* Look at each successor of E->dest to see if we can thread through it. */
FOR_EACH_EDGE (taken_edge, ei, e->dest->succs) FOR_EACH_EDGE (taken_edge, ei, e->dest->succs)
{ {
/* Push a fresh marker so we can unwind the equivalences created
for each of E->dest's successors. */
stack->safe_push (NULL_TREE);
/* Avoid threading to any block we have already visited. */ /* Avoid threading to any block we have already visited. */
bitmap_clear (visited); bitmap_clear (visited);
bitmap_set_bit (visited, taken_edge->dest->index); bitmap_set_bit (visited, taken_edge->dest->index);
@ -1118,6 +1122,9 @@ thread_across_edge (gimple dummy_cond,
{ {
delete_jump_thread_path (path); delete_jump_thread_path (path);
} }
/* And unwind the equivalence table. */
remove_temporary_equivalences (stack);
} }
BITMAP_FREE (visited); BITMAP_FREE (visited);
} }