From: Richard Biener Date: Thu, 9 Jan 2020 10:41:38 +0000 (+0000) Subject: re PR tree-optimization/93054 (ICE in gimple_set_lhs, at gimple.c:1820) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=00294b189cf3285b17b4ca4135341e2614783553;p=gcc.git re PR tree-optimization/93054 (ICE in gimple_set_lhs, at gimple.c:1820) 2020-01-09 Richard Biener PR middle-end/93054 * gimplify.c (gimplify_expr): Deal with NOP definitions. * gcc.dg/pr93054.c: New testcase. From-SVN: r280039 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index dbac2a41cfa..2339a87f99b 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2020-01-09 Richard Biener + + PR middle-end/93054 + * gimplify.c (gimplify_expr): Deal with NOP definitions. + 2020-01-09 Richard Biener PR tree-optimization/93040 diff --git a/gcc/gimplify.c b/gcc/gimplify.c index 73fb2e7cd7e..4243d3a83b8 100644 --- a/gcc/gimplify.c +++ b/gcc/gimplify.c @@ -14622,7 +14622,8 @@ gimplify_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p, { /* Avoid the extra copy if possible. */ *expr_p = create_tmp_reg (TREE_TYPE (name)); - gimple_set_lhs (SSA_NAME_DEF_STMT (name), *expr_p); + if (!gimple_nop_p (SSA_NAME_DEF_STMT (name))) + gimple_set_lhs (SSA_NAME_DEF_STMT (name), *expr_p); release_ssa_name (name); } } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 0e18082a829..71106d10033 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2020-01-09 Richard Biener + + PR middle-end/93054 + * gcc.dg/pr93054.c: New testcase. + 2020-01-09 Richard Biener PR tree-optimization/93040 diff --git a/gcc/testsuite/gcc.dg/pr93054.c b/gcc/testsuite/gcc.dg/pr93054.c new file mode 100644 index 00000000000..1d4680d28e6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr93054.c @@ -0,0 +1,10 @@ +/* { dg-do compile } */ + +__attribute__ ((returns_twice)) int +bp (int); + +__attribute__ ((noreturn)) int +cb (void) +{ + return bp (cb ()); /* { dg-warning "declared .noreturn." } */ +}