This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/15739] New: Convert strstr into strchr if we are looking for a single character.
- 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:25:52 -0000
- Subject: [Bug tree-optimization/15739] New: Convert strstr into strchr if we are looking for a single character.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
char *
foo (const char *haystack)
{
const char *needle = "a";
return strstr (haystack, needle);
}
I get:
foo (haystack)
{
const char * needle;
char * T.0;
<bb 0>:
T.0_3 = strstr (haystack_2, "a") [tail call];
return T.0_3;
}
--
Summary: Convert strstr into strchr if we are looking for a
single character.
Product: gcc
Version: 3.5.0
Status: UNCONFIRMED
Severity: enhancement
Priority: P2
Component: tree-optimization
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: kazu at cs dot umass dot edu
CC: gcc-bugs at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15739