From eb57efa5c6e0b0c3b5ff9c0b4b764d937c98731c Mon Sep 17 00:00:00 2001 From: marxin Date: Mon, 2 Jul 2018 07:04:20 +0000 Subject: [PATCH] Revert 2 ::get to ::get_create for IPA summaries (PR ipa/86279). 2018-07-02 Martin Liska PR ipa/86279 * ipa-pure-const.c (malloc_candidate_p): Revert usage of ::get. (propagate_nothrow): Likewise. 2018-07-02 Martin Liska PR ipa/86279 * gcc.dg/ipa/pr86279.c: New test. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@262298 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 6 ++++++ gcc/ipa-pure-const.c | 5 ++--- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/gcc.dg/ipa/pr86279.c | 25 +++++++++++++++++++++++++ 4 files changed, 38 insertions(+), 3 deletions(-) create mode 100644 gcc/testsuite/gcc.dg/ipa/pr86279.c diff --git a/gcc/ChangeLog b/gcc/ChangeLog index bc9edec6247..5c1b097c2af 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,11 @@ 2018-07-02 Martin Liska + PR ipa/86279 + * ipa-pure-const.c (malloc_candidate_p): Revert usage of ::get. + (propagate_nothrow): Likewise. + +2018-07-02 Martin Liska + PR ipa/86323 * ipa-inline.c (early_inliner): Revert wrongly added ::get call. diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 714239f8734..dede783bd5f 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -923,8 +923,7 @@ malloc_candidate_p (function *fun, bool ipa) cgraph_edge *cs = node->get_edge (call_stmt); if (cs) { - ipa_call_summary *es = ipa_call_summaries->get (cs); - gcc_assert (es); + ipa_call_summary *es = ipa_call_summaries->get_create (cs); es->is_return_callee_uncaptured = true; } } @@ -1803,7 +1802,7 @@ propagate_nothrow (void) w = node; while (w) { - funct_state w_l = funct_state_summaries->get (w); + funct_state w_l = funct_state_summaries->get_create (w); if (!can_throw && !TREE_NOTHROW (w->decl)) { /* Inline clones share declaration with their offline copies; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 967956fd86e..a043fff2c8f 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,10 @@ 2018-07-02 Martin Liska + PR ipa/86279 + * gcc.dg/ipa/pr86279.c: New test. + +2018-07-02 Martin Liska + PR ipa/86323 * g++.dg/ipa/pr86323.C: New test. diff --git a/gcc/testsuite/gcc.dg/ipa/pr86279.c b/gcc/testsuite/gcc.dg/ipa/pr86279.c new file mode 100644 index 00000000000..a9360213ec6 --- /dev/null +++ b/gcc/testsuite/gcc.dg/ipa/pr86279.c @@ -0,0 +1,25 @@ +/* PR ipa/86279 */ +/* { dg-do compile } */ +/* { dg-options "-fipa-pure-const" } */ + +typedef __SIZE_TYPE__ size_t; +extern inline __attribute__ ((__always_inline__)) +void * +memset (void *x, int y, size_t z) +{ + return __builtin___memset_chk (x, y, z, __builtin_object_size (x, 0)); +} + +void +foo (unsigned char *x, unsigned char *y, unsigned char *z, + unsigned char *w, unsigned int v, int u, int t) +{ + int i; + for (i = 0; i < t; i++) + { + memset (z, x[0], v); + memset (w, y[0], v); + x += u; + } + __builtin_memcpy (z, x, u); +} -- 2.11.4.GIT