public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Only accept BUILT_IN_NORMAL stringops for interesting_stringop_to_profile_p
@ 2015-08-20  4:37 Yangfei (Felix)
  2015-08-20  8:16 ` Richard Biener
  0 siblings, 1 reply; 4+ messages in thread
From: Yangfei (Felix) @ 2015-08-20  4:37 UTC (permalink / raw)
  To: gcc-patches; +Cc: Jiangjiji

Hi,

    As DECL_FUNCTION_CODE is overloaded for builtin functions in different classes, so need to check builtin class before using fcode. 
    Patch posted below.  Bootstrapped on x86_64-suse-linux, OK for trunk? 
    Thanks. 

Index: gcc/value-prof.c
===================================================================
--- gcc/value-prof.c	(revision 141081)
+++ gcc/value-prof.c	(working copy)
@@ -1547,8 +1547,12 @@ gimple_ic_transform (gimple_stmt_iterator *gsi)
 static bool
 interesting_stringop_to_profile_p (tree fndecl, gimple call, int *size_arg)
 {
-  enum built_in_function fcode = DECL_FUNCTION_CODE (fndecl);
+  enum built_in_function fcode;
 
+  if (DECL_BUILT_IN_CLASS (fndecl) != BUILT_IN_NORMAL)
+    return false;
+
+  fcode = DECL_FUNCTION_CODE (fndecl);
   if (fcode != BUILT_IN_MEMCPY && fcode != BUILT_IN_MEMPCPY
       && fcode != BUILT_IN_MEMSET && fcode != BUILT_IN_BZERO)
     return false;
Index: gcc/ChangeLog
===================================================================
--- gcc/ChangeLog	(revision 141081)
+++ gcc/ChangeLog	(working copy)
@@ -1,3 +1,9 @@
+2015-08-20  Felix Yang  <felix.yang@huawei.com>
+	    Jiji Jiang  <jiangjiji@huawei.com>
+
+	* value-prof.c (interesting_stringop_to_profile_p): Only accept string
+	operations which belong to the BUILT_IN_NORMAL builtin class.
+
 2015-08-18  Segher Boessenkool  <segher@kernel.crashing.org>
 
 	Backport from mainline:

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-08-20 11:25 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-08-20  4:37 [PATCH] Only accept BUILT_IN_NORMAL stringops for interesting_stringop_to_profile_p Yangfei (Felix)
2015-08-20  8:16 ` Richard Biener
2015-08-20  9:37   ` Yangfei (Felix)
2015-08-20 11:25     ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).