RE: call for libstdc++ profile mode diagnostic ideas

2011-01-05 Thread Hargett, Matt
> Your first example points to a weakness in the compiler optimization. > If base_string constructor is inlined, the compiler should be able to > figure out both 'name' and the heap memory it points to can not be > modified by the call to notify, and therefore hoist access name.c_str > () and name.

Re: call for libstdc++ profile mode diagnostic ideas

2010-12-29 Thread Jonathan Wakely
On 29 December 2010 01:15, Hargett, Matt wrote: > > 1) allocation of std::string in local variable > 2) calls to said local string's c_str() method within loops > 3) and said loops do not modify the contents of the value returned from > c_str() You can't modify the contents, c_str() returns a con

Re: call for libstdc++ profile mode diagnostic ideas

2010-12-28 Thread Xinliang David Li
Your first example points to a weakness in the compiler optimization. If base_string constructor is inlined, the compiler should be able to figure out both 'name' and the heap memory it points to can not be modified by the call to notify, and therefore hoist access name.c_str () and name.length ()

RE: call for libstdc++ profile mode diagnostic ideas

2010-12-28 Thread Hargett, Matt
> I'm planning to add a set of new performance diagnostics to the > libstdc++ profile mode > (http://gcc.gnu.org/onlinedocs/libstdc++/manual/profile_mode.html) and > am trying to come up with a list of what diagnostics are most > meaningful and most wanted. > > At this (brainstorming) point I'm lo