This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug optimization/3511] Inlined strlen() could be smarter
- From: "pinskia at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 Mar 2004 05:41:12 -0000
- Subject: [Bug optimization/3511] Inlined strlen() could be smarter
- References: <20010701093600.3511.86251-quiet@bugs.debian.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From pinskia at gcc dot gnu dot org 2004-03-08 05:40 -------
This shows up in SPEC 2000's 176.gcc, also it might be easier on the tree-ssa:
;; Function mystrlen (mystrlen)
mystrlen (s)
{
long unsigned int T.0;
<bb 0>:
if (s_2 == 0B) goto <L0>; else goto <L1>;
<L0>:;
# s_1 = PHI <s_2(0), ""(1)>;
<L1>:;
T.0_3 = strlen (s_1);
return T.0_3;
}
Moving the constant back to the other basic block and splitting thrid basic block and have
the second basic block goto the last and the first on the false edge goto the new one with
the call to strlen.
--
What |Removed |Added
----------------------------------------------------------------------------
CC| |pinskia at gcc dot gnu dot
| |org
Status|SUSPENDED |NEW
Last reconfirmed|2003-11-05 07:41:23 |2004-03-08 05:41:08
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=3511