From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 46280 invoked by alias); 24 Oct 2017 10:56:14 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 44955 invoked by uid 89); 24 Oct 2017 10:56:13 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=no version=3.3.2 spammy=Hx-languages-length:1672 X-HELO: nikam.ms.mff.cuni.cz Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 24 Oct 2017 10:56:11 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 16202) id AAB4A54897D; Tue, 24 Oct 2017 12:56:08 +0200 (CEST) Date: Tue, 24 Oct 2017 10:57:00 -0000 From: Jan Hubicka To: Prathamesh Kulkarni Cc: gcc Patches , Richard Biener Subject: Re: [RFC] propagate malloc attribute in ipa-pure-const pass Message-ID: <20171024105608.GA62387@kam.mff.cuni.cz> References: <20170926002423.GB22198@kam.mff.cuni.cz> <20170929192803.GA92290@kam.mff.cuni.cz> <20171006130409.GB67693@kam.mff.cuni.cz> <20171007182345.GA64513@kam.mff.cuni.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2017-10/txt/msg01675.txt.bz2 > 2017-10-13 Prathamesh Kulkarni > > * cgraph.h (set_malloc_flag): Declare. > * cgraph.c (set_malloc_flag_1): New function. > (set_malloc_flag): Likewise. > * ipa-fnsummary.h (ipa_call_summary): Add new field is_return_callee. > * ipa-fnsummary.c (ipa_call_summary::reset): Set is_return_callee to > false. > (read_ipa_call_summary): Add support for reading is_return_callee. > (write_ipa_call_summary): Stream is_return_callee. > * ipa-inline.c (ipa_inline): Remove call to ipa_free_fn_summary. > * ipa-pure-const.c: Add headers ssa.h, alloc-pool.h, symbol-summary.h, > ipa-prop.h, ipa-fnsummary.h. > (pure_const_names): Change to static. > (malloc_state_e): Define. > (malloc_state_names): Define. > (funct_state_d): Add field malloc_state. > (varying_state): Set malloc_state to STATE_MALLOC_BOTTOM. > (check_retval_uses): New function. > (malloc_candidate_p): Likewise. > (analyze_function): Add support for malloc attribute. > (pure_const_write_summary): Stream malloc_state. > (pure_const_read_summary): Add support for reading malloc_state. > (dump_malloc_lattice): New function. > (propagate_malloc): New function. > (ipa_pure_const::execute): Call propagate_malloc and > ipa_free_fn_summary. > (pass_local_pure_const::execute): Add support for malloc attribute. > * ssa-iterators.h (RETURN_FROM_IMM_USE_STMT): New macro. > > testsuite/ > * gcc.dg/ipa/propmalloc-1.c: New test-case. > * gcc.dg/ipa/propmalloc-2.c: Likewise. > * gcc.dg/ipa/propmalloc-3.c: Likewise. OK. Perhaps we could also add -Wsuggest-sttribute=malloc and mention it in changes.html? Thanks, Honza