From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 85150 invoked by alias); 10 Jul 2015 12:43:55 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 85089 invoked by uid 48); 10 Jul 2015 12:43:51 -0000 From: "hjl.tools at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug target/66703] [4.9/5/6] gcc.target/i386/readeflags-1.c aborts on -march=i586 or on -miamcu Date: Fri, 10 Jul 2015 12:43:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: target X-Bugzilla-Version: 4.9.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hjl.tools at gmail dot com X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: WONTFIX X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00864.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D66703 --- Comment #5 from H.J. Lu --- (In reply to Uro=C5=A1 Bizjak from comment #4) > This patch makes testcase more robust: >=20 > --cut here-- > Index: readeflags-1.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- readeflags-1.c (revision 225648) > +++ readeflags-1.c (working copy) > @@ -11,10 +11,11 @@ > #define EFLAGS_TYPE unsigned int > #endif >=20=20 > -static EFLAGS_TYPE > +__attribute__((noinline, noclone)) > +EFLAGS_TYPE > readeflags_test (unsigned int a, unsigned int b) > { > - unsigned x =3D (a =3D=3D b); > + volatile char x =3D (a =3D=3D b); > return __readeflags (); > } >=20=20 > --cut here-- It looks fine. Thanks. >>From gcc-bugs-return-491975-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Fri Jul 10 13:05:22 2015 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 4195 invoked by alias); 10 Jul 2015 13:05:21 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 3842 invoked by uid 48); 10 Jul 2015 13:05:17 -0000 From: "pleuba at swissonline dot ch" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/66830] New: Problem with C++ unique symbols in plugins Date: Fri, 10 Jul 2015 13:05:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.9.1 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: pleuba at swissonline dot ch X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2015-07/txt/msg00865.txt.bz2 Content-length: 1612 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66830 Bug ID: 66830 Summary: Problem with C++ unique symbols in plugins Product: gcc Version: 4.9.1 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: pleuba at swissonline dot ch Target Milestone: --- I have a problem in an application loading several plugins using the same library containing a static variable (object of class, not POD) in an inline function. The compiler generates STB_GNU_UNIQUE symbols for the the variable and its guard. Scenario: - dlopen plugin1 (dynamic loader detect the unique variables and mark DSO as not unloadable) - dlopen plugin2 (dynamic loader will uses the unique variables of plugin1 and do NOT mark DSO as unloadable, because its unique symbol is not used) - Invoke some code in plugin2 that call the inline function, so the variable (of plugin 1) is constructed and its guard marked initialized, but the destructor of the variable is incorrectly registered with __cxa_atexit to be called on unload of plugin2. - dlclose the plugin2, so it is unloaded, __CXA_finalize calls the destructor of the global variable owned by plugin1 !, keeping the guard marked as initialised. - If we reload the plugin2, it will not reconstruct the global variable as it is still marked as initialised and access it. This results either immediately or later in crash. Using compiler flag -fno-gnu-unique prevents the problem. Is this problem already known ? Philippe