From c02d2d0adb153f819e75b0d9f62fcdf43ff1954d Mon Sep 17 00:00:00 2001 From: Prathamesh Kulkarni Date: Fri, 5 May 2017 13:21:28 +0000 Subject: [PATCH] re PR tree-optimization/80613 (ICE in is_gimple_reg_type with -O2) 2017-05-05 Prathamesh Kulkarni PR tree-optimization/80613 * tree-ssa-dce.c (propagate_necessity): Remove cases for BUILT_IN_STRDUP and BUILT_IN_STRNDUP. testsuite/ * gcc.dg/tree-ssa/pr79697.c (k): Remove. From-SVN: r247635 --- gcc/ChangeLog | 6 ++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/tree-ssa/pr79697.c | 12 ------------ gcc/tree-ssa-dce.c | 4 +--- 4 files changed, 12 insertions(+), 15 deletions(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 7bc32a9cb5a..5aa46fc0fd1 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,9 @@ +2017-05-05 Prathamesh Kulkarni + + PR tree-optimization/80613 + * tree-ssa-dce.c (propagate_necessity): Remove cases for + BUILT_IN_STRDUP and BUILT_IN_STRNDUP. + 2017-05-05 Richard Biener * tree-ssa-pre.c (get_or_alloc_expr_for): Simplify. diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f9ac3346a7a..a3012e82f3c 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-05-05 Prathamesh Kulkarni + + PR tree-optimization/80613 + * gcc.dg/tree-ssa/pr79697.c (k): Remove. + 2017-05-05 Paolo Carlini PR c++/71577 diff --git a/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c b/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c index d4f64739787..fc3580e3ce3 100644 --- a/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c +++ b/gcc/testsuite/gcc.dg/tree-ssa/pr79697.c @@ -16,18 +16,6 @@ void h(void) __builtin_realloc (0, 10); } -void k(void) -{ - char *p = __builtin_strdup ("abc"); - __builtin_free (p); - - char *q = __builtin_strndup ("abc", 3); - __builtin_free (q); -} - /* { dg-final { scan-tree-dump "Deleting : __builtin_strdup" "cddce1" } } */ /* { dg-final { scan-tree-dump "Deleting : __builtin_strndup" "cddce1" } } */ /* { dg-final { scan-tree-dump "__builtin_malloc" "gimple" } } */ -/* { dg-final { scan-tree-dump-not "__builtin_strdup" "optimized" } } */ -/* { dg-final { scan-tree-dump-not "__builtin_strndup" "optimized" } } */ -/* { dg-final { scan-tree-dump-not "__builtin_free" "optimized" } } */ diff --git a/gcc/tree-ssa-dce.c b/gcc/tree-ssa-dce.c index e17659df91f..4225c3cc1a1 100644 --- a/gcc/tree-ssa-dce.c +++ b/gcc/tree-ssa-dce.c @@ -782,9 +782,7 @@ propagate_necessity (bool aggressive) && DECL_BUILT_IN_CLASS (def_callee) == BUILT_IN_NORMAL && (DECL_FUNCTION_CODE (def_callee) == BUILT_IN_ALIGNED_ALLOC || DECL_FUNCTION_CODE (def_callee) == BUILT_IN_MALLOC - || DECL_FUNCTION_CODE (def_callee) == BUILT_IN_CALLOC - || DECL_FUNCTION_CODE (def_callee) == BUILT_IN_STRDUP - || DECL_FUNCTION_CODE (def_callee) == BUILT_IN_STRNDUP)) + || DECL_FUNCTION_CODE (def_callee) == BUILT_IN_CALLOC)) { gimple *bounds_def_stmt; tree bounds; -- 2.30.2