This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/28553] string processing -O3 optimization bug under GCC 4.1.1
- From: "pcarlini at suse dot de" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Aug 2006 12:02:52 -0000
- Subject: [Bug c++/28553] string processing -O3 optimization bug under GCC 4.1.1
- References: <bug-28553-13035@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #2 from pcarlini at suse dot de 2006-08-01 12:02 -------
The problem cannot be reproduced in mainline, only in 4_1-branch. Seems an
rtl-optimization bug: for the below slightly reduced testcase t97.final_cleanup
is identical in mainline and 4_1-branch:
#include <string>
#include <algorithm>
template<typename InputIter, typename SplitPred>
inline
void
SplitTo(InputIter b, InputIter e, SplitPred sp)
{
InputIter p = std::find_if(b, e, sp);
while (p != e)
{
b = p;
p = std::find_if(b, e, sp);
}
}
template<typename InputIter>
inline
void
SplitTo(InputIter b, InputIter e)
{ SplitTo(b, e, std::bind2nd(std::equal_to<char>(), ';')); }
int
main(void)
{
const std::string& src = "";
SplitTo(src.begin(), src.end());
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28553