aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-ssa-dce.c
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2019-07-29 12:39:46 +0200
committerMartin Liska <marxin@gcc.gnu.org>2019-07-29 10:39:46 +0000
commitfc5e7d2ac42fbc9169458095f4fff257e4a80d03 (patch)
tree227a9d03abbe1c957aabd341678253f32a2db636 /gcc/tree-ssa-dce.c
parent3c2f6fae598f997003b73ab93bb85cb33471f389 (diff)
downloadgcc-fc5e7d2ac42fbc9169458095f4fff257e4a80d03.zip
gcc-fc5e7d2ac42fbc9169458095f4fff257e4a80d03.tar.gz
gcc-fc5e7d2ac42fbc9169458095f4fff257e4a80d03.tar.bz2
Fix ICE seen in tree-ssa-dce.c for new/delete pair.
2019-07-29 Martin Liska <mliska@suse.cz> * tree-ssa-dce.c (eliminate_unnecessary_stmts): Do not remove LHS of operator new call. It's handled latter. 2019-07-29 Martin Liska <mliska@suse.cz> * g++.dg/cpp1y/new1.C (test_unused): Add new case that causes ICE. From-SVN: r273875
Diffstat (limited to 'gcc/tree-ssa-dce.c')
-rw-r--r--gcc/tree-ssa-dce.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c
index 17a8d5e..763b76f 100644
--- a/gcc/tree-ssa-dce.c
+++ b/gcc/tree-ssa-dce.c
@@ -1364,12 +1364,13 @@ eliminate_unnecessary_stmts (void)
did not mark as necessary, it will confuse the
special logic we apply to malloc/free pair removal. */
&& (!(call = gimple_call_fndecl (stmt))
- || DECL_BUILT_IN_CLASS (call) != BUILT_IN_NORMAL
- || (DECL_FUNCTION_CODE (call) != BUILT_IN_ALIGNED_ALLOC
- && DECL_FUNCTION_CODE (call) != BUILT_IN_MALLOC
- && DECL_FUNCTION_CODE (call) != BUILT_IN_CALLOC
- && !ALLOCA_FUNCTION_CODE_P
- (DECL_FUNCTION_CODE (call)))))
+ || ((DECL_BUILT_IN_CLASS (call) != BUILT_IN_NORMAL
+ || (DECL_FUNCTION_CODE (call) != BUILT_IN_ALIGNED_ALLOC
+ && DECL_FUNCTION_CODE (call) != BUILT_IN_MALLOC
+ && DECL_FUNCTION_CODE (call) != BUILT_IN_CALLOC
+ && !ALLOCA_FUNCTION_CODE_P
+ (DECL_FUNCTION_CODE (call))))
+ && !DECL_IS_REPLACEABLE_OPERATOR_NEW_P (call))))
{
something_changed = true;
if (dump_file && (dump_flags & TDF_DETAILS))