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 c++/28553] string processing -O3 optimization bug under GCC 4.1.1



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


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