This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15739] Fold strstr at tree level.
- From: "kazu at cs dot umass dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 30 May 2004 22:29:57 -0000
- Subject: [Bug tree-optimization/15739] Fold strstr at tree level.
- References: <20040530222551.15739.kazu@cs.umass.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From kazu at cs dot umass dot edu 2004-05-30 22:29 -------
char *
bar (void)
{
const char *haystack = "abcd";
const char *needle = "a";
return strstr (haystack, needle);
}
I get:
bar ()
{
const char * needle;
const char * haystack;
char * T.0;
<bb 0>:
T.0_3 = strstr ("abcd", "a") [tail call];
return T.0_3;
}
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords|missed-optimization |
Summary|Convert strstr into strchr |Fold strstr at tree level.
|if we are looking for a |
|single character. |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15739