Commit b5f5f2fd by Tom de Vries Committed by Tom de Vries

re PR tree-optimization/51879 (Missed tail merging with non-const/pure calls)

2012-04-27  Tom de Vries  <tom@codesourcery.com>

	PR tree-optimization/51879
	* gcc.dg/pr51879.c: New test.
	* gcc.dg/pr51879-2.c: Same.
	* gcc.dg/pr51879-3.c: Same.
	* gcc.dg/pr51879-4.c: Same.
	* gcc.dg/pr51879-6.c: Same.

From-SVN: r186895
parent 00115921
2012-04-27 Tom de Vries <tom@codesourcery.com>
PR tree-optimization/51879
* gcc.dg/pr51879.c: New test.
* gcc.dg/pr51879-2.c: Same.
* gcc.dg/pr51879-3.c: Same.
* gcc.dg/pr51879-4.c: Same.
* gcc.dg/pr51879-6.c: Same.
2012-04-26 Paolo Carlini <paolo.carlini@oracle.com> 2012-04-26 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/53096 PR c++/53096
......
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int bar (int);
void baz (int);
void
foo (int y)
{
int a;
if (y)
baz (bar (7) + 6);
else
baz (bar (7) + 6);
}
/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
/* { dg-final { scan-tree-dump-times "baz \\(" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int bar (int);
void baz (int);
void
foo (int y)
{
int a;
if (y == 6)
a = bar (7) + 6;
else
a = bar (7) + 6;
baz (a);
}
/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int bar (int);
void baz (int);
int foo (int y)
{
int a, b;
a = bar (7) + 6;
b = bar (7) + 6;
return a + b;
}
/* { dg-final { scan-tree-dump-times "bar \\(" 2 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int bar (int);
void baz (int);
void bla (int);
void
foo (int y)
{
int a;
if (y == 6)
{
bla (5);
a = bar (7);
}
else
{
bla (5);
a = bar (7);
}
baz (a);
}
/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int bar (int);
void baz (int);
void
foo (int y)
{
int a;
if (y == 6)
a = bar (7);
else
a = bar (7);
baz (a);
}
/* { dg-final { scan-tree-dump-times "bar \\(" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */
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