This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/55812] Unnecessary TLS accesses
- From: "glisse at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 26 Dec 2012 15:43:50 +0000
- Subject: [Bug tree-optimization/55812] Unnecessary TLS accesses
- Auto-submitted: auto-generated
- References: <bug-55812-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55812
--- Comment #1 from Marc Glisse <glisse at gcc dot gnu.org> 2012-12-26 15:43:50 UTC ---
More precisely, the following seems equivalent to me and gets back all the
performance, so it would be good if gcc could turn the original code into this
one.
#include <vector>
thread_local std::vector<int> v;
int main(){
std::vector<int>*vp=&v;
for(long i=0;i<400000000;++i){
vp->push_back(i);
}
return vp->size();
}