re PR middle-end/81207 (tree check fail in simplify_builtin_call)

PR middle-end/81207
	* gimple-fold.c (replace_call_with_call_and_fold): Handle
	gimple_vuse copying separately from gimple_vdef copying.

	* gcc.c-torture/compile/pr81207.c: New test.

From-SVN: r249679
This commit is contained in:
Jakub Jelinek 2017-06-27 10:16:10 +02:00 committed by Jakub Jelinek
parent ccfde6b73a
commit b8c5e47875
4 changed files with 26 additions and 1 deletions

View File

@ -1,3 +1,9 @@
2017-06-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/81207
* gimple-fold.c (replace_call_with_call_and_fold): Handle
gimple_vuse copying separately from gimple_vdef copying.
2017-06-24 Jim Wilson <jim.wilson@linaro.org>
* config/aarch64/aarch64-cost-tables.h (qdf24xx_extra_costs): Move to

View File

@ -606,9 +606,10 @@ replace_call_with_call_and_fold (gimple_stmt_iterator *gsi, gimple *repl)
&& TREE_CODE (gimple_vdef (stmt)) == SSA_NAME)
{
gimple_set_vdef (repl, gimple_vdef (stmt));
gimple_set_vuse (repl, gimple_vuse (stmt));
SSA_NAME_DEF_STMT (gimple_vdef (repl)) = repl;
}
if (gimple_vuse (stmt))
gimple_set_vuse (repl, gimple_vuse (stmt));
gsi_replace (gsi, repl, false);
fold_stmt (gsi);
}

View File

@ -1,3 +1,8 @@
2017-06-27 Jakub Jelinek <jakub@redhat.com>
PR middle-end/81207
* gcc.c-torture/compile/pr81207.c: New test.
2017-06-26 Eric Botcazou <ebotcazou@adacore.com>
* c-c++-common/ubsan/sanitize-recover-7.c (dg-options): Add -w.

View File

@ -0,0 +1,13 @@
/* PR middle-end/81207 */
static const char *b[2] = { "'", "" };
int
foo (const char *d)
{
int e;
for (e = 0; b[e]; e++)
if (__builtin_strstr (d, b[e]))
return 1;
return 0;
}