Commit cf96bae7 by Richard Guenther Committed by Richard Biener

re PR lto/44143 (-fdump-tree-all for lto does not work as expected)

2010-05-18  Richard Guenther  <rguenther@suse.de>

	PR lto/44143
	* lto-wrapper.c (verbose): New variable.  Initialize from -v.
	(debug): Initialize from -save-temps.
	(collect_execute): Print command-line when verbose.
	(run_gcc): Always use COLLECT_GCC_OPTIONS.  Use fork_execute
	for ltrans invocation.  Produce -dumpbase flag again.
	(process_args): Remove.
	(main): Simplify.
	* collect2.c (maybe_run_lto_and_relink): Only pass object
	files to lto-wrapper.
	* gcc.c (LINK_COMMAND_SPEC): Likewise.

From-SVN: r159536
parent 80e2a014
2010-05-18 Richard Guenther <rguenther@suse.de>
PR lto/44143
* lto-wrapper.c (verbose): New variable. Initialize from -v.
(debug): Initialize from -save-temps.
(collect_execute): Print command-line when verbose.
(run_gcc): Always use COLLECT_GCC_OPTIONS. Use fork_execute
for ltrans invocation. Produce -dumpbase flag again.
(process_args): Remove.
(main): Simplify.
* collect2.c (maybe_run_lto_and_relink): Only pass object
files to lto-wrapper.
* gcc.c (LINK_COMMAND_SPEC): Likewise.
2010-05-18 Jan Hubicka <jh@suse.cz>
* opts.c (decode_options): Do not disable whopr at ipa_cp.
......
......@@ -940,10 +940,8 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst,
if (lto_objects.first)
{
const char *opts;
char **lto_c_argv;
const char **lto_c_ptr;
const char *cp;
const char **p, **q, **r;
const char **lto_o_ptr;
struct lto_object *list;
......@@ -954,52 +952,15 @@ maybe_run_lto_and_relink (char **lto_ld_argv, char **object_lst,
if (!lto_wrapper)
fatal ("COLLECT_LTO_WRAPPER must be set.");
/* There is at least one object file containing LTO info,
so we need to run the LTO back end and relink. */
/* Get compiler options passed down from the parent `gcc' command.
These must be passed to the LTO back end. */
opts = getenv ("COLLECT_GCC_OPTIONS");
/* Increment the argument count by the number of inherited options.
Some arguments may be filtered out later. Again, an upper bound
suffices. */
cp = opts;
while (cp && *cp)
{
extract_string (&cp);
num_lto_c_args++;
}
obstack_free (&temporary_obstack, temporary_firstobj);
if (debug)
num_lto_c_args++;
/* Increment the argument count by the number of initial
arguments added below. */
num_lto_c_args += 9;
/* There is at least one object file containing LTO info,
so we need to run the LTO back end and relink. */
lto_c_argv = (char **) xcalloc (sizeof (char *), num_lto_c_args);
lto_c_ptr = CONST_CAST2 (const char **, char **, lto_c_argv);
*lto_c_ptr++ = lto_wrapper;
*lto_c_ptr++ = c_file_name;
cp = opts;
while (cp && *cp)
{
const char *s = extract_string (&cp);
/* Pass the option or argument to the wrapper. */
*lto_c_ptr++ = xstrdup (s);
}
obstack_free (&temporary_obstack, temporary_firstobj);
if (debug)
*lto_c_ptr++ = xstrdup ("-debug");
/* Add LTO objects to the wrapper command line. */
for (list = lto_objects.first; list; list = list->next)
......
......@@ -781,15 +781,9 @@ proper position among the other output files. */
%{fuse-linker-plugin: \
-plugin %(linker_plugin_file) \
-plugin-opt=%(lto_wrapper) \
-plugin-opt=%(lto_gcc) \
-plugin-opt=-fresolution=%u.res \
%{static|static-libgcc:-plugin-opt=-pass-through=%(lto_libgcc)} \
%{static:-plugin-opt=-pass-through=-lc} \
%{O*:-plugin-opt=-O%*} \
%{w:-plugin-opt=-w} \
%{f*:-plugin-opt=-f%*} \
%{m*:-plugin-opt=-m%*} \
%{v:-plugin-opt=-v} \
} \
%{flto} %{fwhopr} %l " LINK_PIE_SPEC \
"%X %{o*} %{A} %{d} %{e*} %{m} %{N} %{n} %{r}\
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment