This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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]

[RFA:] fix non-tls regression with "PATCH: libstdc++/include/profile bug fixes and cleanup"


> Date: Sun, 10 Jan 2010 00:34:19 -0800
> From: Silvius Rus <rus@google.com>

> On Thu, Jan 7, 2010 at 7:38 PM, Benjamin Kosnik <bkoz@redhat.com> wrote:
> >
> > > All of the changes are either serious bug fixes, cleanup requested by
> > > maintainers or minor features agreed previously by maintainers.
> > > This is the last round of changes for the profile mode for 4.5.
> >
> > Yay. Great to see this.
> >
> > > 1. Fix bug: Initialization would possibly run more than once on
> > > multithreaded programs due to missing fence.
> > > Fix by using compare_and_swap to set the state.
> > >
> > > 2. Fix bug: Reentrance guard mechanism was broken since
> > > http://gcc.gnu.org/ml/gcc-patches/2009-11/msg00890.html.
> > > Fix guard logic.
> >
> > Whoops, sorry about that. Might want to add a small check to the
> > testsuite (at at later date) to catch this in the future, since it is
> > important.
> >
> 
> No problem.  Yes, I'll add a sanity check.

Perhaps you did, but I don't see one in 155786 nor elsewhere in
ext/profile?  Or I might have misunderstood.

> Fixed all the test failures except for the synopsis.cc issues.
> Retested linux/x86_64, make check-profile.
> 
> Submitted 155786.

Causing, for non-tls-targets like cris-elf, the regression:

Running /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/libstdc++-dg/conformance.exp ...
...
FAIL: ext/profile/all.cc (test for excess errors)

with .log:
In file included from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/impl/profiler_hash_func.h:51:0,
                 from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/impl/profiler.h:412,
                 from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/base.h:44,
                 from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/map.h:38,
                 from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/map:38,
                 from /tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/map:69,
                 from /tmp/hpautotest-gcc1/gcc/libstdc++-v3/testsuite/ext/profile/all.cc:23:
/tmp/hpautotest-gcc1/cris-elf/gccobj/cris-elf/libstdc++-v3/include/profile/impl/profiler_trace.h:62:2: error: #error You do not seem to have TLS support, which is required by the profile mode. If your program is not multithreaded, recompile with -D_GLIBCXX_PROFILE_NO_THREADS
compiler exited with status 1

>From the patch-set contents it seems this would be the obvious
correction; it keeps the behaviour of the pre-existing test.
(Might want to add a *-linux*-restricted test *without* the -D.)
*And* you should have some test that *emits* that text, but that
too should be a separate test.

But, I'm not sure the below choice is obvious enough; it might
be that maintainers want to keep it as-is and have the
no-threads-alternative as a separate test.

Tested cris-elf.
Ok?

	* testsuite/ext/profile/all.cc: Pass -D_GLIBCXX_PROFILE_NO_THREADS.

Index: libstdc++-v3/testsuite/ext/profile/all.cc
===================================================================
--- libstdc++-v3/testsuite/ext/profile/all.cc	(revision 155826)
+++ libstdc++-v3/testsuite/ext/profile/all.cc	(working copy)
@@ -1,4 +1,4 @@
-// { dg-options "-std=gnu++0x -O0 -D_GLIBCXX_PROFILE" }
+// { dg-options "-std=gnu++0x -O0 -D_GLIBCXX_PROFILE -D_GLIBCXX_PROFILE_NO_THREADS" }
 // { dg-do compile }
 
 // -*- C++ -*-

brgds, H-P


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