public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug lto/45496] New: Static members of templates cause LTO to omit required code
@ 2010-09-02 11:25 alexey at feldgendler dot ru
2010-09-02 11:27 ` [Bug lto/45496] " alexey at feldgendler dot ru
` (24 more replies)
0 siblings, 25 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:25 UTC (permalink / raw)
To: gcc-bugs
Compiling and linking these two files together should succeed.
/* BEGIN 1.cpp */
int callme();
int main(int argc, char** argv) { return callme(); }
/* END 1.cpp */
/* BEGIN 2.cpp */
template<typename T> struct holder { static int var; };
template<typename T> int holder<T>::var = 0;
int callme() { return holder<void>::var; }
/* END 2.cpp */
Indeed, compiling and linking them together without LTO succeeds. However, with
LTO, linking fails because of an undefined reference:
$ g++-4.5 -flto 1.cpp 2.cpp
/tmp/ccORg22M.lto.o: In function `main':
ccsrvz5g.o:(.text+0x10): undefined reference to `_Z6callmev'
collect2: ld returned 1 exit status
--
Summary: Static members of templates cause LTO to omit required
code
Product: gcc
Version: 4.5.1
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: lto
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: alexey at feldgendler dot ru
GCC build triplet: x86_64-linux-gnu
GCC host triplet: x86_64-linux-gnu
GCC target triplet: x86_64-linux-gnu
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
@ 2010-09-02 11:27 ` alexey at feldgendler dot ru
2010-09-02 11:27 ` alexey at feldgendler dot ru
` (23 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from alexey at feldgendler dot ru 2010-09-02 11:27 -------
Created an attachment (id=21656)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21656&action=view)
TC (2.cpp)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
2010-09-02 11:27 ` [Bug lto/45496] " alexey at feldgendler dot ru
@ 2010-09-02 11:27 ` alexey at feldgendler dot ru
2010-09-02 11:32 ` alexey at feldgendler dot ru
` (22 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:27 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from alexey at feldgendler dot ru 2010-09-02 11:27 -------
Created an attachment (id=21655)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21655&action=view)
TC (file 1)
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
2010-09-02 11:27 ` [Bug lto/45496] " alexey at feldgendler dot ru
2010-09-02 11:27 ` alexey at feldgendler dot ru
@ 2010-09-02 11:32 ` alexey at feldgendler dot ru
2010-09-02 11:35 ` alexey at feldgendler dot ru
` (21 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:32 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from alexey at feldgendler dot ru 2010-09-02 11:31 -------
Output of "gcc-4.5 -v 1.cpp 2.cpp":
$ g++-4.5 -v -flto 1.cpp 2.cpp
Using built-in specs.
COLLECT_GCC=g++-4.5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --with-plugin-ld=ld.gold --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.1 (Debian 4.5.1-2)
COLLECT_GCC_OPTIONS='-v' '-flto' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/cc1plus -quiet -v -D_GNU_SOURCE 1.cpp
-quiet -dumpbase 1.cpp -mtune=generic -march=x86-64 -auxbase 1 -version -flto
-o /tmp/ccTWKMfh.s
GNU C++ (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.5
/usr/include/c++/4.5/x86_64-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/include
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/include-fixed
/usr/include
End of search list.
GNU C++ (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 088ccc0edd14ed2073ed25e2d6963850
COLLECT_GCC_OPTIONS='-v' '-flto' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
as -V -Qy --64 -o /tmp/cctwxZZ0.o /tmp/ccTWKMfh.s
GNU assembler version 2.20.51 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.20.51-system.20100813
COLLECT_GCC_OPTIONS='-v' '-flto' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/cc1plus -quiet -v -D_GNU_SOURCE 2.cpp
-quiet -dumpbase 2.cpp -mtune=generic -march=x86-64 -auxbase 2 -version -flto
-o /tmp/ccTWKMfh.s
GNU C++ (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu"
ignoring nonexistent directory
"/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../x86_64-linux-gnu/include"
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/c++/4.5
/usr/include/c++/4.5/x86_64-linux-gnu
/usr/include/c++/4.5/backward
/usr/local/include
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/include
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/include-fixed
/usr/include
End of search list.
GNU C++ (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
Compiler executable checksum: 088ccc0edd14ed2073ed25e2d6963850
COLLECT_GCC_OPTIONS='-v' '-flto' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
as -V -Qy --64 -o /tmp/ccBnOlNK.o /tmp/ccTWKMfh.s
GNU assembler version 2.20.51 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.20.51-system.20100813
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-v' '-flto' '-shared-libgcc' '-mtune=generic'
'-march=x86-64'
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/collect2 -flto --build-id --no-add-needed
--eh-frame-hdr -m elf_x86_64 --hash-style=both -dynamic-linker
/lib64/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../..
/tmp/cctwxZZ0.o /tmp/ccBnOlNK.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crtn.o
collect2 version 4.5.1 (x86-64 Linux/ELF)
/usr/bin/ld --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64
--hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../..
/tmp/cctwxZZ0.o /tmp/ccBnOlNK.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crtn.o
/usr/bin/nm -n /usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crt1.o
/usr/bin/nm -n /usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crti.o
/usr/bin/nm -n /usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtbegin.o
/usr/bin/nm -n /tmp/cctwxZZ0.o
/usr/bin/nm -n /tmp/ccBnOlNK.o
/usr/bin/nm -n /usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtend.o
/usr/bin/nm -n /usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crtn.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto-wrapper /usr/bin/g++-4.5 -v -flto
-shared-libgcc -mtune=generic -march=x86-64 /tmp/cctwxZZ0.o /tmp/ccBnOlNK.o
Using built-in specs.
COLLECT_GCC=/usr/bin/g++-4.5
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.5.1-2'
--with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs
--enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr
--program-suffix=-4.5 --enable-shared --enable-multiarch
--enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib
--without-included-gettext --enable-threads=posix
--with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib --enable-nls
--enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes
--enable-plugin --enable-gold --with-plugin-ld=ld.gold --enable-objc-gc
--with-arch-32=i586 --with-tune=generic --enable-checking=release
--build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.5.1 (Debian 4.5.1-2)
COLLECT_GCC_OPTIONS='-combine' '-c' '-o' '/tmp/ccBMTyip.lto.o' '-v'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-shared-libgcc'
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto1 -quiet -dumpbase cctwxZZ0.o
-mtune=generic -march=x86-64 -auxbase-strip /tmp/ccBMTyip.lto.o -version
@/tmp/ccUVd5Pp -o /tmp/ccRFnsT9.s
GNU GIMPLE (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
GNU GIMPLE (Debian 4.5.1-2) version 4.5.1 (x86_64-linux-gnu)
compiled by GNU C version 4.5.1, GMP version 4.3.2, MPFR version
3.0.0-p3, MPC version 0.8.2
warning: GMP header version 4.3.2 differs from library version 4.2.2.
GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072
COLLECT_GCC_OPTIONS='-combine' '-c' '-o' '/tmp/ccBMTyip.lto.o' '-v'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-shared-libgcc'
as -V -Qy --64 -o /tmp/ccBMTyip.lto.o /tmp/ccRFnsT9.s
GNU assembler version 2.20.51 (x86_64-linux-gnu) using BFD version (GNU
Binutils for Debian) 2.20.51-system.20100813
COMPILER_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/
LIBRARY_PATH=/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/../lib64/:/lib/../lib64/../lib64/:/usr/lib/../lib64/../lib64/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/:/lib/../lib64/:/usr/lib/../lib64/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../:/lib/:/usr/lib/:/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../:/lib/:/usr/lib/
COLLECT_GCC_OPTIONS='-combine' '-c' '-o' '/tmp/ccBMTyip.lto.o' '-v'
'-shared-libgcc' '-mtune=generic' '-march=x86-64' '-shared-libgcc'
/usr/bin/ld --build-id --no-add-needed --eh-frame-hdr -m elf_x86_64
--hash-style=both -dynamic-linker /lib64/ld-linux-x86-64.so.2
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crt1.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crti.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtbegin.o
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1
-L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64 -L/lib/../lib64
-L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../..
/tmp/ccBMTyip.lto.o -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/crtend.o
/usr/lib/gcc/x86_64-linux-gnu/4.5.1/../../../../lib64/crtn.o
/tmp/ccBMTyip.lto.o: In function `main':
cctwxZZ0.o:(.text+0x10): undefined reference to `_Z6callmev'
collect2: ld returned 1 exit status
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (2 preceding siblings ...)
2010-09-02 11:32 ` alexey at feldgendler dot ru
@ 2010-09-02 11:35 ` alexey at feldgendler dot ru
2010-09-02 11:36 ` alexey at feldgendler dot ru
` (20 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:35 UTC (permalink / raw)
To: gcc-bugs
------- Comment #4 from alexey at feldgendler dot ru 2010-09-02 11:35 -------
Created an attachment (id=21657)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21657&action=view)
Assembly for 1.cpp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (3 preceding siblings ...)
2010-09-02 11:35 ` alexey at feldgendler dot ru
@ 2010-09-02 11:36 ` alexey at feldgendler dot ru
2010-09-02 11:38 ` rguenth at gcc dot gnu dot org
` (19 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:36 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from alexey at feldgendler dot ru 2010-09-02 11:35 -------
Created an attachment (id=21658)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21658&action=view)
Assembly for 2.cpp
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (4 preceding siblings ...)
2010-09-02 11:36 ` alexey at feldgendler dot ru
@ 2010-09-02 11:38 ` rguenth at gcc dot gnu dot org
2010-09-02 11:39 ` alexey at feldgendler dot ru
` (18 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 11:38 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from rguenth at gcc dot gnu dot org 2010-09-02 11:38 -------
It works for me with 4.5.0, 4.5.1 and current trunk.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (5 preceding siblings ...)
2010-09-02 11:38 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 11:39 ` alexey at feldgendler dot ru
2010-09-02 11:40 ` alexey at feldgendler dot ru
` (17 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:39 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from alexey at feldgendler dot ru 2010-09-02 11:38 -------
Created an attachment (id=21660)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21660&action=view)
Assembly after LTO for entire program
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (6 preceding siblings ...)
2010-09-02 11:39 ` alexey at feldgendler dot ru
@ 2010-09-02 11:40 ` alexey at feldgendler dot ru
2010-09-02 11:57 ` alexey at feldgendler dot ru
` (16 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from alexey at feldgendler dot ru 2010-09-02 11:40 -------
Attached assembler files generated for 1.cpp and 2.cpp, as well as the
assembler file generated by the LTO pass. As can be seen from the latter,
_Z6callmev is referenced but not defined.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (7 preceding siblings ...)
2010-09-02 11:40 ` alexey at feldgendler dot ru
@ 2010-09-02 11:57 ` alexey at feldgendler dot ru
2010-09-02 12:00 ` alexey at feldgendler dot ru
` (15 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 11:57 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from alexey at feldgendler dot ru 2010-09-02 11:57 -------
Output of lto1 without -quiet:
$ /usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto1 1.o 2.o
Performing interprocedural optimizations
<whole-program> <inline>Assembling functions:
main
Execution times (seconds)
TOTAL : 0.00 0.00 0.01
1138 kB
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (8 preceding siblings ...)
2010-09-02 11:57 ` alexey at feldgendler dot ru
@ 2010-09-02 12:00 ` alexey at feldgendler dot ru
2010-09-02 12:04 ` alexey at feldgendler dot ru
` (14 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 12:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from alexey at feldgendler dot ru 2010-09-02 11:59 -------
Created an attachment (id=21662)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21662&action=view)
-fdump-ipa-cgraph from LTO pass
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (9 preceding siblings ...)
2010-09-02 12:00 ` alexey at feldgendler dot ru
@ 2010-09-02 12:04 ` alexey at feldgendler dot ru
2010-09-02 12:13 ` alexey at feldgendler dot ru
` (13 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 12:04 UTC (permalink / raw)
To: gcc-bugs
------- Comment #11 from alexey at feldgendler dot ru 2010-09-02 12:04 -------
Attached cgraph dump from "/usr/lib/gcc/x86_64-linux-gnu/4.5.1/lto1
-fdump-ipa-cgraph 1.o 2.o". For some reason, though, lto1 creates only one dump
file, and that only covers its first input infile.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (10 preceding siblings ...)
2010-09-02 12:04 ` alexey at feldgendler dot ru
@ 2010-09-02 12:13 ` alexey at feldgendler dot ru
2010-09-02 12:56 ` rguenth at gcc dot gnu dot org
` (12 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 12:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #12 from alexey at feldgendler dot ru 2010-09-02 12:13 -------
Could it be specific to x86_64-linux-gnu?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (11 preceding siblings ...)
2010-09-02 12:13 ` alexey at feldgendler dot ru
@ 2010-09-02 12:56 ` rguenth at gcc dot gnu dot org
2010-09-02 14:40 ` alexey at feldgendler dot ru
` (11 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 12:56 UTC (permalink / raw)
To: gcc-bugs
------- Comment #13 from rguenth at gcc dot gnu dot org 2010-09-02 12:56 -------
It works for me on x86_64-linux-gnu.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (12 preceding siblings ...)
2010-09-02 12:56 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 14:40 ` alexey at feldgendler dot ru
2010-09-02 14:43 ` alexey at feldgendler dot ru
` (10 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 14:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #14 from alexey at feldgendler dot ru 2010-09-02 14:40 -------
Created an attachment (id=21665)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21665&action=view)
Assembly for 2.cpp
Re-uploaded 2.s.
--
alexey at feldgendler dot ru changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #21658|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (13 preceding siblings ...)
2010-09-02 14:40 ` alexey at feldgendler dot ru
@ 2010-09-02 14:43 ` alexey at feldgendler dot ru
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
` (9 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 14:43 UTC (permalink / raw)
To: gcc-bugs
------- Comment #15 from alexey at feldgendler dot ru 2010-09-02 14:43 -------
Created an attachment (id=21666)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21666&action=view)
Assembly for 1.cpp
Re-uploaded 1.s.
--
alexey at feldgendler dot ru changed:
What |Removed |Added
----------------------------------------------------------------------------
Attachment #21657|0 |1
is obsolete| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (14 preceding siblings ...)
2010-09-02 14:43 ` alexey at feldgendler dot ru
@ 2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
` (8 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 14:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #16 from rguenth at gcc dot gnu dot org 2010-09-02 14:45 -------
Created an attachment (id=21667)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21667&action=view)
working one
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (15 preceding siblings ...)
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
2010-09-02 14:51 ` alexey at feldgendler dot ru
` (7 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 14:46 UTC (permalink / raw)
To: gcc-bugs
------- Comment #17 from rguenth at gcc dot gnu dot org 2010-09-02 14:46 -------
Created an attachment (id=21668)
--> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=21668&action=view)
working one
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug lto/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (16 preceding siblings ...)
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 14:51 ` alexey at feldgendler dot ru
2010-09-02 15:00 ` [Bug middle-end/45496] " rguenth at gcc dot gnu dot org
` (6 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 14:51 UTC (permalink / raw)
To: gcc-bugs
------- Comment #18 from alexey at feldgendler dot ru 2010-09-02 14:51 -------
Further research: the LTO pass on either the affected or unaffected
installation fails if one or both .s files come from the affected installation,
but succeeds with both .s files from the unaffected installation.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (17 preceding siblings ...)
2010-09-02 14:51 ` alexey at feldgendler dot ru
@ 2010-09-02 15:00 ` rguenth at gcc dot gnu dot org
2010-09-02 15:14 ` alexey at feldgendler dot ru
` (5 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 15:00 UTC (permalink / raw)
To: gcc-bugs
------- Comment #19 from rguenth at gcc dot gnu dot org 2010-09-02 15:00 -------
The important difference is
@@ -83,7 +83,7 @@
.weak _ZN6holderIvE3varE
.section
.bss._ZN6holderIvE3varE,"awG",@nobits,_ZN6holderIvE3varE,comdat
.align 4
- .type _ZN6holderIvE3varE, @object
+ .type _ZN6holderIvE3varE, @gnu_unique_object
.size _ZN6holderIvE3varE, 4
_ZN6holderIvE3varE:
.zero 4
so it seems that HAVE_GAS_GNU_UNIQUE_OBJECT / USE_GNU_UNIQUE_OBJECT in
elfos.h is broken.
Confirmed.
CCing Jason who added it.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu dot org
Status|UNCONFIRMED |NEW
Component|lto |middle-end
Ever Confirmed|0 |1
Keywords| |lto
Last reconfirmed|0000-00-00 00:00:00 |2010-09-02 15:00:22
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (18 preceding siblings ...)
2010-09-02 15:00 ` [Bug middle-end/45496] " rguenth at gcc dot gnu dot org
@ 2010-09-02 15:14 ` alexey at feldgendler dot ru
2010-09-02 15:24 ` rguenth at gcc dot gnu dot org
` (4 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 15:14 UTC (permalink / raw)
To: gcc-bugs
------- Comment #20 from alexey at feldgendler dot ru 2010-09-02 15:13 -------
Indeed, when gcc is configured with --disable-gnu-unique-object, the bug
doesn't occur.
binutils 2.20.1-12 from Debian.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (19 preceding siblings ...)
2010-09-02 15:14 ` alexey at feldgendler dot ru
@ 2010-09-02 15:24 ` rguenth at gcc dot gnu dot org
2010-09-02 15:34 ` rguenth at gcc dot gnu dot org
` (3 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 15:24 UTC (permalink / raw)
To: gcc-bugs
------- Comment #21 from rguenth at gcc dot gnu dot org 2010-09-02 15:23 -------
Last guess in the wild is that libelf0 (from libelf) doesn't handle the
object file like it should and we somehow silently treat it as an empty one.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (20 preceding siblings ...)
2010-09-02 15:24 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 15:34 ` rguenth at gcc dot gnu dot org
2010-09-02 15:55 ` alexey at feldgendler dot ru
` (2 subsequent siblings)
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-02 15:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #22 from rguenth at gcc dot gnu dot org 2010-09-02 15:34 -------
Fixed with http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161935 on trunk.
Needs backporting. I'll do that. Can you verify this fixes your problem?
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |rguenth at gcc dot gnu dot
|dot org |org
Status|NEW |ASSIGNED
Last reconfirmed|2010-09-02 15:00:22 |2010-09-02 15:34:25
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (21 preceding siblings ...)
2010-09-02 15:34 ` rguenth at gcc dot gnu dot org
@ 2010-09-02 15:55 ` alexey at feldgendler dot ru
2010-09-03 9:47 ` rguenth at gcc dot gnu dot org
2010-09-03 9:48 ` rguenth at gcc dot gnu dot org
24 siblings, 0 replies; 26+ messages in thread
From: alexey at feldgendler dot ru @ 2010-09-02 15:55 UTC (permalink / raw)
To: gcc-bugs
------- Comment #23 from alexey at feldgendler dot ru 2010-09-02 15:55 -------
Yes, the patch fixes the observed bug. Thanks a lot!
However, there's also the issue of missing error reporting for a failure to
read ELF. I don't know if it should be fixed as part of this bug or separately.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (22 preceding siblings ...)
2010-09-02 15:55 ` alexey at feldgendler dot ru
@ 2010-09-03 9:47 ` rguenth at gcc dot gnu dot org
2010-09-03 9:48 ` rguenth at gcc dot gnu dot org
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-03 9:47 UTC (permalink / raw)
To: gcc-bugs
------- Comment #24 from rguenth at gcc dot gnu dot org 2010-09-03 09:47 -------
Fixed for 4.5.2.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Target Milestone|--- |4.5.2
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
* [Bug middle-end/45496] Static members of templates cause LTO to omit required code
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
` (23 preceding siblings ...)
2010-09-03 9:47 ` rguenth at gcc dot gnu dot org
@ 2010-09-03 9:48 ` rguenth at gcc dot gnu dot org
24 siblings, 0 replies; 26+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2010-09-03 9:48 UTC (permalink / raw)
To: gcc-bugs
------- Comment #25 from rguenth at gcc dot gnu dot org 2010-09-03 09:48 -------
Subject: Bug 45496
Author: rguenth
Date: Fri Sep 3 09:47:09 2010
New Revision: 163801
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=163801
Log:
2010-09-03 Richard Guenther <rguenther@suse.de>
* lto-elf.c (validate_file): Always error if validation fails.
2010-09-03 Richard Guenther <rguenther@suse.de>
PR lto/45496
Backport from mainline
2010-07-07 Jakub Jelinek <jakub@redhat.com>
* lto-elf.c (ELFOSABI_NONE, ELFOSABI_LINUX): Define if not defined.
(validate_file): Allow merging of ELFOSABI_NONE with ELFOSABI_LINUX
objects.
Modified:
branches/gcc-4_5-branch/gcc/lto/ChangeLog
branches/gcc-4_5-branch/gcc/lto/lto-elf.c
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45496
^ permalink raw reply [flat|nested] 26+ messages in thread
end of thread, other threads:[~2010-09-03 9:48 UTC | newest]
Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-02 11:25 [Bug lto/45496] New: Static members of templates cause LTO to omit required code alexey at feldgendler dot ru
2010-09-02 11:27 ` [Bug lto/45496] " alexey at feldgendler dot ru
2010-09-02 11:27 ` alexey at feldgendler dot ru
2010-09-02 11:32 ` alexey at feldgendler dot ru
2010-09-02 11:35 ` alexey at feldgendler dot ru
2010-09-02 11:36 ` alexey at feldgendler dot ru
2010-09-02 11:38 ` rguenth at gcc dot gnu dot org
2010-09-02 11:39 ` alexey at feldgendler dot ru
2010-09-02 11:40 ` alexey at feldgendler dot ru
2010-09-02 11:57 ` alexey at feldgendler dot ru
2010-09-02 12:00 ` alexey at feldgendler dot ru
2010-09-02 12:04 ` alexey at feldgendler dot ru
2010-09-02 12:13 ` alexey at feldgendler dot ru
2010-09-02 12:56 ` rguenth at gcc dot gnu dot org
2010-09-02 14:40 ` alexey at feldgendler dot ru
2010-09-02 14:43 ` alexey at feldgendler dot ru
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
2010-09-02 14:46 ` rguenth at gcc dot gnu dot org
2010-09-02 14:51 ` alexey at feldgendler dot ru
2010-09-02 15:00 ` [Bug middle-end/45496] " rguenth at gcc dot gnu dot org
2010-09-02 15:14 ` alexey at feldgendler dot ru
2010-09-02 15:24 ` rguenth at gcc dot gnu dot org
2010-09-02 15:34 ` rguenth at gcc dot gnu dot org
2010-09-02 15:55 ` alexey at feldgendler dot ru
2010-09-03 9:47 ` rguenth at gcc dot gnu dot org
2010-09-03 9:48 ` rguenth at gcc dot gnu dot 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).