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]

[LTO][PATCH] Fix lto input clobbering bug.


Hi,

   This patch fixes a problem where an input object file to LTO can be
overwritten if -fwhopr is used.  The problem is that we ran the
assembler when lto1 does not produce any meaningful output and the
assember uses the same name of one of the input objects as output
filename.  Tested on i686-unknown-linux-gnu

-Doug

2008-10-28  Doug Kwan  <dougkwan@google.com>

	* gcc.c (invoke_as): Do not invoke assembler if -fwpa is given
	in command line.

Index: gcc/gcc/gcc.c
===================================================================
--- gcc/gcc/gcc.c	(revision 141406)
+++ gcc/gcc/gcc.c	(working copy)
@@ -886,9 +886,9 @@ static const char *asm_options =

 static const char *invoke_as =
 #ifdef AS_NEEDS_DASH_FOR_PIPED_INPUT
-"%{!S:-o %|.s |\n as %(asm_options) %|.s %A }";
+"%{!fwpa:%{!S:-o %|.s |\n as %(asm_options) %|.s %A }}";
 #else
-"%{!S:-o %|.s |\n as %(asm_options) %m.s %A }";
+"%{!fwpa:%{!S:-o %|.s |\n as %(asm_options) %m.s %A }}";
 #endif

 /* Some compilers have limits on line lengths, and the multilib_select


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