re PR middle-end/43864 (Same basic blocks should be merged)

2011-09-27  Tom de Vries  <tom@codesourcery.com>

	PR middle-end/43864
	* gcc.dg/fold-compare-2.c (dg-options): Add -fno-tree-tail-merge.
	* gcc/testsuite/gcc.dg/uninit-pred-2_c.c: Same.
	* gcc.dg/pr43864.c: New test.
	* gcc.dg/pr43864-2.c: Same.
	* gcc.dg/pr43864-3.c: Same.
	* gcc.dg/pr43864-4.c: Same.

From-SVN: r179276
This commit is contained in:
Tom de Vries 2011-09-27 16:12:35 +00:00 committed by Tom de Vries
parent c9e9316807
commit baaa40aeca
7 changed files with 120 additions and 2 deletions

View File

@ -1,3 +1,13 @@
2011-09-27 Tom de Vries <tom@codesourcery.com>
PR middle-end/43864
* gcc.dg/fold-compare-2.c (dg-options): Add -fno-tree-tail-merge.
* gcc/testsuite/gcc.dg/uninit-pred-2_c.c: Same.
* gcc.dg/pr43864.c: New test.
* gcc.dg/pr43864-2.c: Same.
* gcc.dg/pr43864-3.c: Same.
* gcc.dg/pr43864-4.c: Same.
2011-09-27 Jan Hubicka <jh@suse.cz>
* gcc.dg/ipa/inline-5.c: New testcase.

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-vrp1" } */
/* { dg-options "-O2 -fno-tree-tail-merge -fdump-tree-vrp1" } */
extern void abort (void);

View File

@ -0,0 +1,22 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
int
f (int c, int b, int d)
{
int r, e;
if (c)
r = b + d;
else
{
e = b + d;
r = e;
}
return r;
}
/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */

View File

@ -0,0 +1,23 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
/* Commutative case. */
int f(int c, int b, int d)
{
int r, e;
if (c)
r = b + d;
else
{
e = d + b;
r = e;
}
return r;
}
/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */

View File

@ -0,0 +1,28 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
/* Different stmt order. */
int f(int c, int b, int d)
{
int r, r2, e;
if (c)
{
r = b + d;
r2 = d - b;
}
else
{
r2 = d - b;
e = d + b;
r = e;
}
return r - r2;
}
/* { dg-final { scan-tree-dump-times "if " 0 "pre"} } */
/* { dg-final { scan-tree-dump-times "_.*\\\+.*_" 1 "pre"} } */
/* { dg-final { scan-tree-dump-times " - " 2 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */

View File

@ -0,0 +1,35 @@
/* { dg-do compile } */
/* { dg-options "-O2 -fdump-tree-pre" } */
extern void foo (char*, int);
extern void mysprintf (char *, char *);
extern void myfree (void *);
extern int access (char *, int);
extern int fopen (char *, int);
char *
hprofStartupp (char *outputFileName, char *ctx)
{
char fileName[1000];
int fp;
mysprintf (fileName, outputFileName);
if (access (fileName, 1) == 0)
{
myfree (ctx);
return 0;
}
fp = fopen (fileName, 0);
if (fp == 0)
{
myfree (ctx);
return 0;
}
foo (outputFileName, fp);
return ctx;
}
/* { dg-final { scan-tree-dump-times "myfree \\(" 1 "pre"} } */
/* { dg-final { cleanup-tree-dump "pre" } } */

View File

@ -1,5 +1,5 @@
/* { dg-do compile } */
/* { dg-options "-Wuninitialized -O2" } */
/* { dg-options "-Wuninitialized -O2 -fno-tree-tail-merge" } */
int g;
void bar (void);