From: Martin Liska Date: Fri, 3 Apr 2020 10:33:41 +0000 (+0200) Subject: Backport 55a7380213a5c16120d5c674fb42b38a3d796b57 X-Git-Tag: embedded-9-2020q2~38 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=69df6742cb4e15fba5ee074629a78811e61f044d;p=thirdparty%2Fgcc.git Backport 55a7380213a5c16120d5c674fb42b38a3d796b57 Backport from mainline 2020-04-03 Martin Liska PR ipa/94445 * ipa-icf-gimple.c (func_checker::compare_gimple_call): Compare type attributes for gimple_call_fntypes. --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index a64777282a6e..04e297cd4552 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,12 @@ +2020-04-03 Martin Liska + + Backport from mainline + 2020-04-03 Martin Liska + + PR ipa/94445 + * ipa-icf-gimple.c (func_checker::compare_gimple_call): + Compare type attributes for gimple_call_fntypes. + 2020-04-02 Fritz Reese Backport from master. diff --git a/gcc/ipa-icf-gimple.c b/gcc/ipa-icf-gimple.c index 25284936bc35..38e0ac12f7e4 100644 --- a/gcc/ipa-icf-gimple.c +++ b/gcc/ipa-icf-gimple.c @@ -37,6 +37,7 @@ along with GCC; see the file COPYING3. If not see #include "ipa-utils.h" #include "tree-eh.h" #include "builtins.h" +#include "attribs.h" #include "ipa-icf-gimple.h" @@ -768,6 +769,9 @@ func_checker::compare_gimple_call (gcall *s1, gcall *s2) || (fntype1 && !types_compatible_p (fntype1, fntype2))) return return_false_with_msg ("call function types are not compatible"); + if (fntype1 && fntype2 && comp_type_attributes (fntype1, fntype2) != 1) + return return_false_with_msg ("different fntype attributes"); + tree chain1 = gimple_call_chain (s1); tree chain2 = gimple_call_chain (s2); if ((chain1 && !chain2)