[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-11 Thread rguenth at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

Richard Guenther rguenth at gcc dot gnu.org changed:

   What|Removed |Added

 Status|UNCONFIRMED |RESOLVED
 Resolution||FIXED

--- Comment #6 from Richard Guenther rguenth at gcc dot gnu.org 2011-01-11 
12:11:18 UTC ---
Fixed.


[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

--- Comment #1 from Jan Hubicka hubicka at ucw dot cz 2011-01-06 13:18:03 UTC 
---
The bug seems to be that lto-symtab incorrectly sets resolution info of the
callgraph node as unknown.  Looking into it.

Honza


Re: [Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread Jan Hubicka
This is driver bug.  With -flto-partition=none it for whatever reason forgets 
about -fresolution:

 ../lto1 -quiet -dumpdir ./ -dumpbase prog -mtune=generic -march=x86-64 
-auxbase-strip /tmp/cctgIO6R.lto.o -version -flto-partition=none 
-fuse-linker-plugin -fwhole-program -fdump-ipa-all-details @/tmp/ccpDD04R -o 
foo.s 


[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

--- Comment #2 from Jan Hubicka hubicka at ucw dot cz 2011-01-06 13:31:36 UTC 
---
This is driver bug.  With -flto-partition=none it for whatever reason forgets
about -fresolution:

 ../lto1 -quiet -dumpdir ./ -dumpbase prog -mtune=generic -march=x86-64
-auxbase-strip /tmp/cctgIO6R.lto.o -version -flto-partition=none
-fuse-linker-plugin -fwhole-program -fdump-ipa-all-details @/tmp/ccpDD04R -o
foo.s


Re: [Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread Jan Hubicka
The problem is that collect2 should be in LTO_MODE_NONE when plugin is used but
it confuses itself and sets itself into LTO_MODE_LTO. Consequently compilation
is done twice, once correctly with plugin and then once again with collect2
path. 

I am testing the attached patch.  It will also make non-WHOPR mode twice as 
fast ;))

Honza

Index: collect2.c
===
--- collect2.c  (revision 168508)
+++ collect2.c  (working copy)
@@ -1236,7 +1236,7 @@ main (int argc, char **argv)
 #endif
   }
 vflag = debug;
-if (no_partition)
+if (no_partition  lto_mode == LTO_MODE_WHOPR)
   lto_mode = LTO_MODE_LTO;
   }
 


[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread hubicka at ucw dot cz
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

--- Comment #3 from Jan Hubicka hubicka at ucw dot cz 2011-01-06 13:44:09 UTC 
---
The problem is that collect2 should be in LTO_MODE_NONE when plugin is used but
it confuses itself and sets itself into LTO_MODE_LTO. Consequently compilation
is done twice, once correctly with plugin and then once again with collect2
path. 

I am testing the attached patch.  It will also make non-WHOPR mode twice as
fast ;))

Honza

Index: collect2.c
===
--- collect2.c(revision 168508)
+++ collect2.c(working copy)
@@ -1236,7 +1236,7 @@ main (int argc, char **argv)
 #endif
   }
 vflag = debug;
-if (no_partition)
+if (no_partition  lto_mode == LTO_MODE_WHOPR)
   lto_mode = LTO_MODE_LTO;
   }


[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread d.g.gorbachev at gmail dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

--- Comment #4 from Dmitry Gorbachev d.g.gorbachev at gmail dot com 
2011-01-06 14:45:17 UTC ---
Collect2-based LTO (when CFLAGS = -flto -fwhole-program) fails, too.


[Bug lto/47188] Undefined reference errors when combining IR and non-IR object files

2011-01-06 Thread hubicka at gcc dot gnu.org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47188

--- Comment #5 from Jan Hubicka hubicka at gcc dot gnu.org 2011-01-06 
18:50:22 UTC ---
Author: hubicka
Date: Thu Jan  6 18:50:20 2011
New Revision: 168548

URL: http://gcc.gnu.org/viewcvs?root=gccview=revrev=168548
Log:

PR lto/47188
* collect2.c (main): Do not enable LTOmode when plugin is active.
* testsuite/gcc.dg/lto/pr47188_0.c: New testcase.
* testsuite/gcc.dg/lto/pr47188_1.c: New testcase.

Added:
trunk/gcc/testsuite/gcc.dg/lto/pr47188_0.c
trunk/gcc/testsuite/gcc.dg/lto/pr47188_1.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/collect2.c
trunk/gcc/testsuite/ChangeLog