[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-15 Thread Joost dot VandeVondele at pci dot uzh dot ch


--- Comment #6 from Joost dot VandeVondele at pci dot uzh dot ch  
2010-09-15 15:17 ---
OK, fixed with using CVS binutils...

ld -v
GNU gold (GNU Binutils 2.20.51.20100915) 1.10


-- 

Joost dot VandeVondele at pci dot uzh dot ch changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||WORKSFORME


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



[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-14 Thread Joost dot VandeVondele at pci dot uzh dot ch


--- Comment #4 from Joost dot VandeVondele at pci dot uzh dot ch  
2010-09-14 06:04 ---
(In reply to comment #3)
 
 In C means that the build_eri takes a variable arguments.
 
:-) thanks... using 'void (*build_eri)(void);' fixes the warning... now it is
an error only.

gcc -c -flto test_c.c ; gfortran -c -flto test.f90 ; ar -r all.a test_c.o
test.o ; gfortran -fuse-linker-plugin -flto -O3 all.a
/data03/vondele/binutils-2.20.1/build/bin/ld: error: all.a: multiple definition
of 'build_eri'
/data03/vondele/binutils-2.20.1/build/bin/ld: all.a: previous definition here
collect2: ld returned 1 exit status

notice, to reproduce the error, it is essential that the objects are put in the
archive first. I've also some output of -v which seems to indicate it is really
picking up the right version of ld:

COLLECT_GCC_OPTIONS='-v' '-fuse-linker-plugin' '-flto' '-O3' '-shared-libgcc'
'-mtune=generic' '-march=x86-64'

/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/collect2
-plugin
/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/liblto_plugin.so
-plugin-opt=/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cce60n2k.res -flto --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o
/usr/lib/../lib64/crti.o
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../..
all.a -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtend.o
/usr/lib/../lib64/crtn.o
collect2 version 4.6.0 20100913 (experimental) [trunk revision 164246] (x86-64
Linux/ELF)
/data03/vondele/binutils-2.20.1/build/bin/ld -plugin
/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/liblto_plugin.so
-plugin-opt=/data03/vondele/gcc_trunk/build/libexec/gcc/x86_64-unknown-linux-gnu/4.6.0/lto-wrapper
-plugin-opt=-fresolution=/tmp/cce60n2k.res --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 /usr/lib/../lib64/crt1.o
/usr/lib/../lib64/crti.o
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtbegin.o
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../../../lib64
-L/lib/../lib64 -L/usr/lib/../lib64
-L/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/../../..
all.a -lgfortran -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc
/data03/vondele/gcc_trunk/build/lib/gcc/x86_64-unknown-linux-gnu/4.6.0/crtend.o
/usr/lib/../lib64/crtn.o
/data03/vondele/binutils-2.20.1/build/bin/ld: error: all.a: multiple definition
of 'build_eri'
/data03/vondele/binutils-2.20.1/build/bin/ld: all.a: previous definition here
 gfortran @/tmp/ccYIFibu.args


-- 


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



[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-14 Thread Joost dot VandeVondele at pci dot uzh dot ch


--- Comment #5 from Joost dot VandeVondele at pci dot uzh dot ch  
2010-09-14 13:07 ---
A slight variation leads to an lto1 ICE:

declaring build eri as: 'extern void (*build_eri)(void);'

leads to:

 gcc -c -flto test_c.c ; gfortran -c -flto test.f90 ; rm all.a ; ar -r all.a 
 test_c.o test.o ; gfortran -fuse-linker-plugin -flto -O3 all.a
ar: creating all.a
lto1: internal compiler error: in lto_varpool_replace_node, at lto-symtab.c:292
Please submit a full bug report,
with preprocessed source if appropriate.
See http://gcc.gnu.org/bugs.html for instructions.
lto-wrapper: gfortran returned 1 exit status
/data03/vondele/binutils-2.20.1/build/bin/ld: fatal error: lto-wrapper failed
collect2: ld returned 1 exit status


-- 


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



[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-13 Thread rguenth at gcc dot gnu dot org


--- Comment #1 from rguenth at gcc dot gnu dot org  2010-09-13 16:12 ---
It works for me.  I suppose you have older gold with known bugs?  I have

GNU gold (GNU Binutils; SUSE:openSUSE 11.1 2.20.51.20091013-0.1) 1.9
Copyright 2008 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.


-- 


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



[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-13 Thread Joost dot VandeVondele at pci dot uzh dot ch


--- Comment #2 from Joost dot VandeVondele at pci dot uzh dot ch  
2010-09-13 17:13 ---
(In reply to comment #1)
 It works for me.  I suppose you have older gold with known bugs?  I have
 
 GNU gold (GNU Binutils; SUSE:openSUSE 11.1 2.20.51.20091013-0.1) 1.9

my date is more recent but the version number seems not. I think this is
the latest version from http://ftp.gnu.org/gnu/binutils/

 ld -v
GNU gold (GNU Binutils 2.20.1.20100303) 1.9

BTW, the warning seems to come from before the linker (whatever that means with
lto).


-- 


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



[Bug fortran/45659] LTO / function pointers with iso_c_binding

2010-09-13 Thread pinskia at gcc dot gnu dot org


--- Comment #3 from pinskia at gcc dot gnu dot org  2010-09-13 17:58 ---
void (*build_eri)();

In C means something different from:
void (*build_eri)(void);

Please try with the void.

--- CUT --
void (*build_eri)();

In C means that the build_eri takes a variable arguments.


-- 


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