From 33351ff9faa21c4c1af377d661a52ac0ce366db3 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Tue, 18 Feb 2020 14:39:41 +0100 Subject: Drop MALLOC attribute for void functions. PR ipa/93583 * cgraph.c (cgraph_node::verify_node): Verify MALLOC attribute and return type of functions. * ipa-param-manipulation.c (ipa_param_adjustments::adjust_decl): Drop MALLOC attribute for void functions. * ipa-pure-const.c (funct_state_summary_t::duplicate): Drop malloc_state for a new VOID clone. PR ipa/93583 * gcc.dg/ipa/pr93583.c: New test. --- gcc/ipa-param-manipulation.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gcc/ipa-param-manipulation.c') diff --git a/gcc/ipa-param-manipulation.c b/gcc/ipa-param-manipulation.c index 19ec873..839bd2e 100644 --- a/gcc/ipa-param-manipulation.c +++ b/gcc/ipa-param-manipulation.c @@ -410,6 +410,10 @@ ipa_param_adjustments::adjust_decl (tree orig_decl) DECL_VIRTUAL_P (new_decl) = 0; DECL_LANG_SPECIFIC (new_decl) = NULL; + /* Drop MALLOC attribute for a void function. */ + if (m_skip_return) + DECL_IS_MALLOC (new_decl) = 0; + return new_decl; } -- cgit v1.1