ICF: compare type attributes for gimple_call_fntypes.
authorMartin Liska <mliska@suse.cz>
Fri, 3 Apr 2020 07:05:06 +0000 (09:05 +0200)
committerMartin Liska <mliska@suse.cz>
Fri, 3 Apr 2020 07:05:06 +0000 (09:05 +0200)
PR ipa/94445
* ipa-icf-gimple.c (func_checker::compare_gimple_call):
  Compare type attributes for gimple_call_fntypes.

gcc/ChangeLog
gcc/ipa-icf-gimple.c

index 8c57cd58629e24c3a73b7fd898130b11f5ac1d5a..3087c58806dc6742f3c167e585a9139a965ab6be 100644 (file)
@@ -1,3 +1,9 @@
+2020-04-03  Martin Liska  <mliska@suse.cz>
+
+       PR ipa/94445
+       * ipa-icf-gimple.c (func_checker::compare_gimple_call):
+         Compare type attributes for gimple_call_fntypes.
+
 2020-04-02  Sandra Loosemore  <sandra@codesourcery.com>
 
        * alias.c (get_alias_set): Fix comment typos.
index d306fec56cec5f0e38f659d7350c2e264a294066..1cd5872c03de0f0f9b1abb65c965d327fd302eb0 100644 (file)
@@ -37,6 +37,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "tree-eh.h"
 #include "builtins.h"
 #include "cfgloop.h"
+#include "attribs.h"
 
 #include "ipa-icf-gimple.h"
 
@@ -570,6 +571,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)