This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix PR43071


-fcompare-debug wasn't designed to work with LTO/WHOPR - it doesn't
preserve the -gtoggle compile variant for the later link step and
thus runs into PR44951.  The following makes sure that -fcompare-debug
is restricted to the compile-step, as it was implemented for.

Build and tested on i686-linux-gnu, applied.

Richard.

2010-07-23  Richard Guenther  <rguenther@suse.de>

	PR lto/43071
	* gcc.c (LINK_COMMAND_SPEC): Filter out -fcompare-debug
	for -flto and -fwhopr.

	* g++.dg/lto/20100723-1_0.C: New testcase.

Index: gcc/gcc.c
===================================================================
*** gcc/gcc.c	(revision 162477)
--- gcc/gcc.c	(working copy)
*************** proper position among the other output f
*** 752,757 ****
--- 752,758 ----
      %{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)}	\
      %{static:-plugin-opt=-pass-through=-lc}	\
      } \
+     %{flto:%<fcompare-debug*} %{fwhopr*:%<fcompare-debug*} \
      %{flto} %{fwhopr*} %l " LINK_PIE_SPEC \
     "%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
      %{s} %{t} %{u*} %{x} %{z} %{Z} %{!A:%{!nostdlib:%{!nostartfiles:%S}}}\
Index: gcc/testsuite/g++.dg/lto/20100723-1_0.C
===================================================================
*** gcc/testsuite/g++.dg/lto/20100723-1_0.C	(revision 0)
--- gcc/testsuite/g++.dg/lto/20100723-1_0.C	(revision 0)
***************
*** 0 ****
--- 1,12 ----
+ /* { dg-lto-do link } */
+ /* { dg-lto-options {{-fcompare-debug -flto} {-fcompare-debug -fwhopr}} } */
+ 
+ struct S {
+     virtual void f() { }
+ };
+ 
+ int main(int, char *[])
+ {
+   S s;
+   return 0;
+ }


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]