This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[LTO][PATCH] Fix lto input clobbering bug.
- From: "=?big5?b?RG91ZyBLd2FuICjD9q62vHcp?=" <dougkwan at google dot com>
- To: gcc-patches <gcc-patches at gcc dot gnu dot org>, "Diego Novillo" <dnovillo at google dot com>
- Date: Tue, 28 Oct 2008 05:07:18 -0700
- Subject: [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