https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66173

            Bug ID: 66173
           Summary: -fno-threadsafe-statics suppresses guard functions but
                    not guard variables
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: eleventen at gmail dot com
  Target Milestone: ---

Created attachment 35553
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=35553&action=edit
Source file demonstrating that the guard variable isn't suppressed.

The use of the -fno-threadsafe-statics eliminates the function references to
the guard functions,

__cxa_guard_acquire
__cxa_guard_release


but it doesn't eliminate the variables used to guard the initialization.  A
compiled version of the attached file using the g++ command line therein
generated no references to the guard functions, but the guard variable remains.

# nm -C guard | grep guard
0000000000600a88 b guard variable for f()::a

Reply via email to