public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
@ 2012-07-09  4:59 vincenzo.innocente at cern dot ch
  2012-07-09  6:28 ` [Bug lto/53895] " hjl.tools at gmail dot com
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-07-09  4:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

             Bug #: 53895
           Summary: [4.7.2/4.8 Regression][lto] symbol
                    'std::__once_callable' used as both __thread and
                    non-__thread
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: lto
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: vincenzo.innocente@cern.ch


I'm sure was working with 4.7.1
works with gcc version 4.7.0 20120507 (Red Hat 4.7.0-5) (GCC) 

this is ok
c++ thread.cpp -pthread -std=gnu++0x -O2 
this is not
c++ thread.cpp -pthread -std=gnu++0x -O2 -flto
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/bin/ld: error:
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib64/libstdc++.so:
symbol 'std::__once_call' used as both __thread and non-__thread
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/bin/ld: /tmp/innocent/ccd0XlxC.o:
previous definition here
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/bin/ld: error:
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/lib/gcc/x86_64-unknown-linux-gnu/4.7.2/../../../../lib64/libstdc++.so:
symbol 'std::__once_callable' used as both __thread and non-__thread
/afs/cern.ch/user/i/innocent/w3/gcc47slc5/bin/ld: /tmp/innocent/ccd0XlxC.o:
previous definition here
collect2: error: ld returned 1 exit status

ld -v
GNU gold (GNU Binutils 2.22.52.20120515) 1.11
gcc version 4.7.2 20120629 (prerelease) [gcc-4_7-branch revision 189081] (GCC)
gcc version 4.8.0 20120623 (experimental) [trunk revision 188906] (GCC) 
gcc version 4.8.0 20120708 (experimental) [trunk revision 189362] (GCC) 


cat thread.cpp
include <iostream>
#include <sstream>
#include <vector>
#include <thread>
#include <mutex>
#include <future>
#include <atomic>
#include <functional>
#include <algorithm>

typedef std::thread Thread;
typedef std::vector<std::thread> ThreadGroup;
typedef std::mutex Mutex;
typedef std::unique_lock<std::mutex> Guard;
typedef std::condition_variable Condition;


long long threadId() {
  std::stringstream ss;
  ss << std::this_thread::get_id();
  long long id;
  ss >> id;
  return id; 
}


namespace global {
  // control cout....
  Mutex coutLock;
}


int main() {

  return 0;
}


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
@ 2012-07-09  6:28 ` hjl.tools at gmail dot com
  2012-07-09  8:38 ` [Bug lto/53895] [4.7/4.8 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2012-07-09  6:28 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

H.J. Lu <hjl.tools at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
   Last reconfirmed|                            |2012-07-09
     Ever Confirmed|0                           |1

--- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-07-09 06:28:27 UTC ---
Does it work with BFD linker?


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
  2012-07-09  6:28 ` [Bug lto/53895] " hjl.tools at gmail dot com
@ 2012-07-09  8:38 ` rguenth at gcc dot gnu.org
  2012-07-09 12:20 ` vincenzo.innocente at cern dot ch
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: rguenth at gcc dot gnu.org @ 2012-07-09  8:38 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

Richard Guenther <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.1
   Target Milestone|---                         |4.7.2
            Summary|[4.7.2/4.8 Regression][lto] |[4.7/4.8 Regression][lto]
                   |symbol                      |symbol
                   |'std::__once_callable' used |'std::__once_callable' used
                   |as both __thread and        |as both __thread and
                   |non-__thread                |non-__thread
      Known to fail|                            |4.7.2


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
  2012-07-09  6:28 ` [Bug lto/53895] " hjl.tools at gmail dot com
  2012-07-09  8:38 ` [Bug lto/53895] [4.7/4.8 " rguenth at gcc dot gnu.org
@ 2012-07-09 12:20 ` vincenzo.innocente at cern dot ch
  2012-07-09 13:16 ` hjl.tools at gmail dot com
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-07-09 12:20 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

--- Comment #2 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-07-09 12:20:41 UTC ---
yes it does
ld -v
GNU ld version 2.22.52.0.1-10.fc17 20120131
[innocent@pcphsftkepler bugs48]$ c++ thread.cpp -pthread -std=gnu++0x -O2 -flto
-Wl,-v
collect2 version 4.8.0 20120623 (experimental) [trunk revision 188906]
/home/innocent/gccDir/bin/ld -plugin
/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/liblto_plugin.so
-plugin-opt=/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccm8JDgc.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 /lib/../lib64/crt1.o /lib/../lib64/crti.o
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtbegin.o
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../..
/tmp/ccUiBvi2.o -v -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtend.o
/lib/../lib64/crtn.o
GNU ld version 2.22.52.0.1-10.fc17 20120131
[innocent@pcphsftkepler bugs48]$ mv  ~/gccDir/bin/ld.gold ~/gccDir/bin/ld     
[innocent@pcphsftkepler bugs48]$ c++ thread.cpp -pthread -std=gnu++0x -O2 -flto
-Wl,-v
collect2 version 4.8.0 20120623 (experimental) [trunk revision 188906]
/home/innocent/gccDir/bin/ld -plugin
/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/liblto_plugin.so
-plugin-opt=/home/innocent/gccDir/libexec/gcc/x86_64-unknown-linux-gnu/4.8.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/ccJLE7SG.res -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lgcc --eh-frame-hdr -m elf_x86_64 -dynamic-linker
/lib64/ld-linux-x86-64.so.2 /lib/../lib64/crt1.o /lib/../lib64/crti.o
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtbegin.o
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../..
/tmp/ccevajLa.o -v -lstdc++ -lm -lgcc_s -lgcc -lpthread -lc -lgcc_s -lgcc
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/crtend.o
/lib/../lib64/crtn.o
GNU gold (version 2.22.52.0.1-10.fc17 20120131) 1.11
/home/innocent/gccDir/bin/ld: error:
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libstdc++.so:
symbol 'std::__once_callable' used as both __thread and non-__thread
/home/innocent/gccDir/bin/ld: /tmp/ccevajLa.o: previous definition here
/home/innocent/gccDir/bin/ld: error:
/home/innocent/gccDir/lib/gcc/x86_64-unknown-linux-gnu/4.8.0/../../../../lib64/libstdc++.so:
symbol 'std::__once_call' used as both __thread and non-__thread
/home/innocent/gccDir/bin/ld: /tmp/ccevajLa.o: previous definition here
collect2: error: ld returned 1 exit status


On 9 Jul, 2012, at 4:28 PM, hjl.tools at gmail dot com wrote:

> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895
> 
> H.J. Lu <hjl.tools at gmail dot com> changed:
> 
>           What    |Removed                     |Added
> ----------------------------------------------------------------------------
>             Status|UNCONFIRMED                 |WAITING
>   Last reconfirmed|                            |2012-07-09
>     Ever Confirmed|0                           |1
> 
> --- Comment #1 from H.J. Lu <hjl.tools at gmail dot com> 2012-07-09 06:28:27 UTC ---
> Does it work with BFD linker?
> 
> -- 
> Configure bugmail: http://gcc.gnu.org/bugzilla/userprefs.cgi?tab=email
> ------- You are receiving this mail because: -------
> You reported the bug.

--
Il est bon de suivre sa pente, pourvu que ce soit en montant. 
A.G.
http://www.flickr.com/photos/vin60/1320965757/


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
                   ` (2 preceding siblings ...)
  2012-07-09 12:20 ` vincenzo.innocente at cern dot ch
@ 2012-07-09 13:16 ` hjl.tools at gmail dot com
  2012-07-16 11:12 ` marvin24 at gmx dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: hjl.tools at gmail dot com @ 2012-07-09 13:16 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

--- Comment #3 from H.J. Lu <hjl.tools at gmail dot com> 2012-07-09 13:15:34 UTC ---
(In reply to comment #2)
> yes it does
> ld -v
> GNU ld version 2.22.52.0.1-10.fc17 20120131
> [innocent@pcphsftkepler bugs48]$ c++ thread.cpp -pthread -std=gnu++0x -O2 -flto
> -Wl,-v

It sounds like a gold bug.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
                   ` (3 preceding siblings ...)
  2012-07-09 13:16 ` hjl.tools at gmail dot com
@ 2012-07-16 11:12 ` marvin24 at gmx dot de
  2012-08-15  6:59 ` vincenzo.innocente at cern dot ch
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: marvin24 at gmx dot de @ 2012-07-16 11:12 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

Marc Dietrich <marvin24 at gmx dot de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |marvin24 at gmx dot de

--- Comment #4 from Marc Dietrich <marvin24 at gmx dot de> 2012-07-16 11:12:42 UTC ---
also triggered when compiling mesa with -ftlo:


g++ -O2 -Wall -std=c99 -Werror=implicit-function-declaration
-Werror=missing-prototypes -fno-strict-aliasing -fno-builtin-memcmp -O2
-flto=jobserver -fPIC  -D_GNU_SOURCE -DPTHREADS -DTEXTURE_FLOAT_ENABLED
-DUSE_X86_64_ASM -DHAVE_POSIX_MEMALIGN -DIN_DRI_DRIVER -DUSE_XCB
-DGLX_INDIRECT_RENDERING -DGLX_DIRECT_RENDERING -DGLX_USE_TLS -DPTHREADS
-DUSE_EXTERNAL_DXTN_LIB=1 -DIN_DRI_DRIVER -DHAVE_ALIAS -DHAVE_MINCORE
-DHAVE_LIBUDEV -DHAVE_LLVM=0x0301 -fvisibility=hidden -o r600_dri.so.test
../../../../src/mesa/drivers/dri/common/dri_test.o r600_dri.so.tmp 
../../../../lib64/libdricore8.1.0.so  -ldrm   -lexpat -lm -lpthread -ldl
-ldrm_radeon -march=barcelona -Ofast -flto=jobserver -L/usr/lib  -lpthread -ldl
-lm ;
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
error: r600_dri.so.tmp: symbol '_glapi_tls_Context' used as both __thread and
non-__thread
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
../../../../src/mesa/drivers/dri/common/dri_test.o: previous definition here
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
error: r600_dri.so.tmp: symbol '_glapi_tls_Dispatch' used as both __thread and
non-__thread
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
../../../../src/mesa/drivers/dri/common/dri_test.o: previous definition here
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
error: ../../../../lib64/libdricore8.1.0.so: symbol '_glapi_tls_Context' used
as both __thread and non-__thread
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
../../../../src/mesa/drivers/dri/common/dri_test.o: previous definition here
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
error: ../../../../lib64/libdricore8.1.0.so: symbol '_glapi_tls_Dispatch' used
as both __thread and non-__thread
/usr/lib64/gcc/x86_64-suse-linux/4.7/../../../../x86_64-suse-linux/bin/ld:
../../../../src/mesa/drivers/dri/common/dri_test.o: previous definition here

on openSUSE 12.2 (factory):
ld --version -> GNU gold (GNU Binutils; openSUSE Factory 2.22) 1.11
gcc --version -> gcc (SUSE Linux) 4.7.1 20120615 [gcc-4_7-branch revision
188649]


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
                   ` (4 preceding siblings ...)
  2012-07-16 11:12 ` marvin24 at gmx dot de
@ 2012-08-15  6:59 ` vincenzo.innocente at cern dot ch
  2012-09-20 10:28 ` jakub at gcc dot gnu.org
  2013-01-01  5:28 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: vincenzo.innocente at cern dot ch @ 2012-08-15  6:59 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

--- Comment #5 from vincenzo Innocente <vincenzo.innocente at cern dot ch> 2012-08-15 06:58:49 UTC ---
btw I opened a gold bug
http://sourceware.org/bugzilla/show_bug.cgi?id=14342
which did not get any attention yet


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
                   ` (5 preceding siblings ...)
  2012-08-15  6:59 ` vincenzo.innocente at cern dot ch
@ 2012-09-20 10:28 ` jakub at gcc dot gnu.org
  2013-01-01  5:28 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: jakub at gcc dot gnu.org @ 2012-09-20 10:28 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.7.2                       |4.7.3

--- Comment #6 from Jakub Jelinek <jakub at gcc dot gnu.org> 2012-09-20 10:17:55 UTC ---
GCC 4.7.2 has been released.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [Bug lto/53895] [4.7/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread
  2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
                   ` (6 preceding siblings ...)
  2012-09-20 10:28 ` jakub at gcc dot gnu.org
@ 2013-01-01  5:28 ` pinskia at gcc dot gnu.org
  7 siblings, 0 replies; 9+ messages in thread
From: pinskia at gcc dot gnu.org @ 2013-01-01  5:28 UTC (permalink / raw)
  To: gcc-bugs


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53895

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |MOVED

--- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> 2013-01-01 05:27:49 UTC ---
Since a gold bug has been opened, closing this as moved.


^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2013-01-01  5:28 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-09  4:59 [Bug lto/53895] New: [4.7.2/4.8 Regression][lto] symbol 'std::__once_callable' used as both __thread and non-__thread vincenzo.innocente at cern dot ch
2012-07-09  6:28 ` [Bug lto/53895] " hjl.tools at gmail dot com
2012-07-09  8:38 ` [Bug lto/53895] [4.7/4.8 " rguenth at gcc dot gnu.org
2012-07-09 12:20 ` vincenzo.innocente at cern dot ch
2012-07-09 13:16 ` hjl.tools at gmail dot com
2012-07-16 11:12 ` marvin24 at gmx dot de
2012-08-15  6:59 ` vincenzo.innocente at cern dot ch
2012-09-20 10:28 ` jakub at gcc dot gnu.org
2013-01-01  5:28 ` pinskia at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).