This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug optimization/3511] Inlined strlen() could be smarter


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]