Bug 66173 - -fno-threadsafe-statics suppresses guard functions but not guard variables
Summary: -fno-threadsafe-statics suppresses guard functions but not guard variables
Status: RESOLVED DUPLICATE of bug 66172
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.9.2
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-16 05:21 UTC by Marc Singer
Modified: 2015-05-16 06:11 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments
Source file demonstrating that the guard variable isn't suppressed. (204 bytes, text/plain)
2015-05-16 05:21 UTC, Marc Singer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marc Singer 2015-05-16 05:21:55 UTC
Created attachment 35553 [details]
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
Comment 1 Marc Singer 2015-05-16 05:43:21 UTC
I neglected to include information about the version of the compiler.  This is a 64 bit compiler on amd64.

# g++ --version
g++ (Debian 4.9.2-10) 4.9.2
Copyright (C) 2014 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Comment 2 Andrew Pinski 2015-05-16 06:11:05 UTC
.

*** This bug has been marked as a duplicate of bug 66172 ***