aboutsummaryrefslogtreecommitdiff
path: root/gcc/gimple-fold.c
diff options
context:
space:
mode:
authorMarek Polacek <polacek@redhat.com>2016-05-24 13:34:37 +0000
committerMarek Polacek <mpolacek@gcc.gnu.org>2016-05-24 13:34:37 +0000
commitabd3a68c1343af515a1f9b5e60f2b6ed94ee1d7a (patch)
tree5012ef61f6549f21b9eb5ed7fd9978b9a7d872f0 /gcc/gimple-fold.c
parent30fd2977745d53f282d1560212e3bea07943a937 (diff)
downloadgcc-abd3a68c1343af515a1f9b5e60f2b6ed94ee1d7a.zip
gcc-abd3a68c1343af515a1f9b5e60f2b6ed94ee1d7a.tar.gz
gcc-abd3a68c1343af515a1f9b5e60f2b6ed94ee1d7a.tar.bz2
tree-cfg.h (should_remove_lhs_p): New predicate.
* tree-cfg.h (should_remove_lhs_p): New predicate. * cgraph.c (cgraph_edge::redirect_call_stmt_to_callee): Use it. * gimplify.c (gimplify_modify_expr): Likewise. * tree-cfg.c (verify_gimple_call): Likewise. * tree-cfgcleanup.c (fixup_noreturn_call): Likewise. * gimple-fold.c: Include "tree-cfg.h". (gimple_fold_call): Use should_remove_lhs_p. From-SVN: r236637
Diffstat (limited to 'gcc/gimple-fold.c')
-rw-r--r--gcc/gimple-fold.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/gcc/gimple-fold.c b/gcc/gimple-fold.c
index 83b7150..d6657e9 100644
--- a/gcc/gimple-fold.c
+++ b/gcc/gimple-fold.c
@@ -54,6 +54,7 @@ along with GCC; see the file COPYING3. If not see
#include "optabs-query.h"
#include "omp-low.h"
#include "ipa-chkp.h"
+#include "tree-cfg.h"
/* Return true when DECL can be referenced from current unit.
@@ -3052,12 +3053,9 @@ gimple_fold_call (gimple_stmt_iterator *gsi, bool inplace)
== void_type_node))
gimple_call_set_fntype (stmt, TREE_TYPE (fndecl));
/* If the call becomes noreturn, remove the lhs. */
- if (lhs
- && (gimple_call_flags (stmt) & ECF_NORETURN)
+ if (gimple_call_noreturn_p (stmt)
&& (VOID_TYPE_P (TREE_TYPE (gimple_call_fntype (stmt)))
- || ((TREE_CODE (TYPE_SIZE_UNIT (TREE_TYPE (lhs)))
- == INTEGER_CST)
- && !TREE_ADDRESSABLE (TREE_TYPE (lhs)))))
+ || should_remove_lhs_p (lhs)))
{
if (TREE_CODE (lhs) == SSA_NAME)
{