[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 --- Comment #6 from Martin Sebor --- That should have read: > ...hide their bodies from the optimizer...

[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 --- Comment #5 from Martin Sebor --- That does work. I had tried with the attribute on the end of the declaration and it barfed. I was going to say I'd worry that declaring the members extern template might effectively hide them from their bodi

[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-18 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 --- Comment #4 from Marc Glisse --- When user specializations are allowed, who knows what might happen. As an experiment, namespace std { extern template __attribute__((pure)) int string::compare(const char*)const; } seems to work. I think

[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-18 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 Martin Sebor changed: What|Removed |Added See Also||https://gcc.gnu.org/bugzill

[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-17 Thread glisse at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 --- Comment #2 from Marc Glisse --- Reminds me of PR 59048 and some others, except that in that one adding "pure" was not sufficient. Is "pure" true for all legal template parameters of basic_string?

[Bug libstdc++/80811] out-of-line string members less efficient than they could be

2017-05-17 Thread msebor at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=80811 --- Comment #1 from Martin Sebor --- There are typos in the example in comment #0. Here's what it should look like: #include void cmp (const std::string &s1, const std::string &s2) { int c1 = s1.compare (s2); int c2 = s1.compare (s2);