diff options
author | Martin Liska <mliska@suse.cz> | 2017-03-13 16:30:17 +0100 |
---|---|---|
committer | Martin Liska <marxin@gcc.gnu.org> | 2017-03-13 15:30:17 +0000 |
commit | a48018b5dc804de7b8c07197bff56e57269d67a2 (patch) | |
tree | 44de64c4674e5e4ad283a8fc5f6aefa0189dcde9 /gcc/ipa-pure-const.c | |
parent | 0e5172ebf287a857364a0e8be216e3231258bc49 (diff) | |
download | gcc-a48018b5dc804de7b8c07197bff56e57269d67a2.zip gcc-a48018b5dc804de7b8c07197bff56e57269d67a2.tar.gz gcc-a48018b5dc804de7b8c07197bff56e57269d67a2.tar.bz2 |
Do not warn -Wsuggest-attribute=noreturn for main.chkp (PR middle-end/78339).
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* ipa-pure-const.c (warn_function_noreturn): If the declarations
is a CHKP clone, use original declaration.
2017-03-13 Martin Liska <mliska@suse.cz>
PR middle-end/78339
* gcc.target/i386/mpx/pr78339.c: New test.
From-SVN: r246098
Diffstat (limited to 'gcc/ipa-pure-const.c')
-rw-r--r-- | gcc/ipa-pure-const.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c index 3781171..e457166 100644 --- a/gcc/ipa-pure-const.c +++ b/gcc/ipa-pure-const.c @@ -218,11 +218,17 @@ warn_function_const (tree decl, bool known_finite) static void warn_function_noreturn (tree decl) { + tree original_decl = decl; + + cgraph_node *node = cgraph_node::get (decl); + if (node->instrumentation_clone) + decl = node->instrumented_version->decl; + static hash_set<tree> *warned_about; if (!lang_hooks.missing_noreturn_ok_p (decl) && targetm.warn_func_return (decl)) warned_about - = suggest_attribute (OPT_Wsuggest_attribute_noreturn, decl, + = suggest_attribute (OPT_Wsuggest_attribute_noreturn, original_decl, true, warned_about, "noreturn"); } |