Index: gcc/testsuite/gcc.dg/pr43864-2.c =================================================================== --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/pr43864-2.c (revision 0) @@ -0,0 +1,22 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +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 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "\\\+" 1 "optimized"} } */ +/* { dg-final { scan-tree-dump-times "PHI" 0 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */ Index: gcc/testsuite/gcc.dg/pr43864.c =================================================================== --- /dev/null (new file) +++ gcc/testsuite/gcc.dg/pr43864.c (revision 0) @@ -0,0 +1,33 @@ +/* { dg-do compile } */ +/* { dg-options "-O2 -fdump-tree-optimized" } */ + +#include +#include + +void foo (char*, FILE*); + +char* hprofStartupp (char *outputFileName, char *ctx) +{ + char fileName[1000]; + FILE *fp; + sprintf (fileName, outputFileName); + if (access (fileName, 1) == 0) + { + free (ctx); + return 0; + } + + fp = fopen (fileName, 0); + if (fp == 0) + { + free (ctx); + return 0; + } + + foo (outputFileName, fp); + + return ctx; +} + +/* { dg-final { scan-tree-dump-times "free" 1 "optimized"} } */ +/* { dg-final { cleanup-tree-dump "optimized" } } */