gcc/
2010-01-03 H.J. Lu <hongjiu.lu@intel.com>
PR lto/41564
* common.opt: Add dumpdir.
* gcc.c (cc1_options): Add "-dumpbase %B" only if -dumpbase
isn't specified.
(option_map): Add --dumpdir.
* gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add dumpdir.
* lto-wrapper.c (run_gcc): Add -dumpbase and -dumpdir for -o.
* opts.c (decode_options): Try dump_dir_name first if
dump_base_name isn't an absolute path.
(common_handle_option): Handle OPT_dumpdir.
* toplev.c (dump_dir_name): New.
(print_switch_values): Also ignore -dumpdir.
* toplev.h (dump_dir_name): New.
gcc/lto/
2010-01-03 H.J. Lu <hongjiu.lu@intel.com>
PR lto/41564
* lto.c (DUMPBASE_SUFFIX): New.
(lto_execute_ltrans): Append a sequence number to -dumpbase
for LTRANS.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@155591
138bc75d-0d04-0410-961f-
82ee72b054a4
+2010-01-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR lto/41564
+ * common.opt: Add dumpdir.
+
+ * gcc.c (cc1_options): Add "-dumpbase %B" only if -dumpbase
+ isn't specified.
+ (option_map): Add --dumpdir.
+
+ * gcc.h (DEFAULT_WORD_SWITCH_TAKES_ARG): Add dumpdir.
+
+ * lto-wrapper.c (run_gcc): Add -dumpbase and -dumpdir for -o.
+
+ * opts.c (decode_options): Try dump_dir_name first if
+ dump_base_name isn't an absolute path.
+ (common_handle_option): Handle OPT_dumpdir.
+
+ * toplev.c (dump_dir_name): New.
+ (print_switch_values): Also ignore -dumpdir.
+
+ * toplev.h (dump_dir_name): New.
+
2010-01-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42589
2010-01-03 Richard Guenther <rguenther@suse.de>
PR tree-optimization/42589
; Options for the language- and target-independent parts of the compiler.
; Options for the language- and target-independent parts of the compiler.
-; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009
+; Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
; Free Software Foundation, Inc.
;
; This file is part of GCC.
; Free Software Foundation, Inc.
;
; This file is part of GCC.
Common Separate
-dumpbase <file> Set the file basename to be used for dumps
Common Separate
-dumpbase <file> Set the file basename to be used for dumps
+dumpdir
+Common Separate
+-dumpdir <dir> Set the directory name to be used for dumps
+
; The version of the C++ ABI in use. The following values are allowed:
;
; 0: The version of the ABI believed most conformant with the C++ ABI
; The version of the C++ ABI in use. The following values are allowed:
;
; 0: The version of the ABI believed most conformant with the C++ ABI
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
/* Compiler driver program that can handle many languages.
Copyright (C) 1987, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009,
+ 2010
Free Software Foundation, Inc.
This file is part of GCC.
Free Software Foundation, Inc.
This file is part of GCC.
/* NB: This is shared amongst all front-ends, except for Ada. */
static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
/* NB: This is shared amongst all front-ends, except for Ada. */
static const char *cc1_options =
"%{pg:%{fomit-frame-pointer:%e-pg and -fomit-frame-pointer are incompatible}}\
- %1 %{!Q:-quiet} -dumpbase %B %{d*} %{m*} %{a*}\
+ %1 %{!Q:-quiet} %{!dumpbase:-dumpbase %B} %{d*} %{m*} %{a*}\
%{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \
%{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
%{fcompare-debug-second:%:compare-debug-auxbase-opt(%b)} \
%{!fcompare-debug-second:%{c|S:%{o*:-auxbase-strip %*}%{!o*:-auxbase %b}}}%{!c:%{!S:-auxbase %b}} \
%{g*} %{O*} %{W*&pedantic*} %{w} %{std*&ansi&trigraphs}\
{"--dependencies", "-M", 0},
{"--dump", "-d", "a"},
{"--dumpbase", "-dumpbase", "a"},
{"--dependencies", "-M", 0},
{"--dump", "-d", "a"},
{"--dumpbase", "-dumpbase", "a"},
+ {"--dumpdir", "-dumpdir", "a"},
{"--encoding", "-fencoding=", "aj"},
{"--entry", "-e", 0},
{"--extra-warnings", "-W", 0},
{"--encoding", "-fencoding=", "aj"},
{"--entry", "-e", 0},
{"--extra-warnings", "-W", 0},
/* Header file for modules that link with gcc.c
/* Header file for modules that link with gcc.c
- Copyright (C) 1999, 2000, 2001, 2003, 2004, 2007, 2008
+ Copyright (C) 1999, 2000, 2001, 2003, 2004, 2007, 2008, 2010
Free Software Foundation, Inc.
This file is part of GCC.
Free Software Foundation, Inc.
This file is part of GCC.
|| !strcmp (STR, "isysroot") \
|| !strcmp (STR, "-param") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
|| !strcmp (STR, "isysroot") \
|| !strcmp (STR, "-param") || !strcmp (STR, "specs") \
|| !strcmp (STR, "MF") || !strcmp (STR, "MT") || !strcmp (STR, "MQ") \
- || !strcmp (STR, "fintrinsic-modules-path") || !strcmp (STR, "dumpbase"))
+ || !strcmp (STR, "fintrinsic-modules-path") \
+ || !strcmp (STR, "dumpbase") || !strcmp (STR, "dumpdir"))
/* These are exported by gcc.c. */
/* These are exported by gcc.c. */
/* Wrapper to call lto. Used by collect2 and the linker plugin.
/* Wrapper to call lto. Used by collect2 and the linker plugin.
- Copyright (C) 2009 Free Software Foundation, Inc.
+ Copyright (C) 2009, 2010 Free Software Foundation, Inc.
Factored out of collect2 by Rafael Espindola <espindola@google.com>
Factored out of collect2 by Rafael Espindola <espindola@google.com>
const char **argv_ptr;
char *list_option_full = NULL;
const char **argv_ptr;
char *list_option_full = NULL;
new_argv = (const char **) xcalloc (sizeof (char *), new_argc);
argv_ptr = new_argv;
new_argv = (const char **) xcalloc (sizeof (char *), new_argc);
argv_ptr = new_argv;
temporary file for the LTO output. The `-o' option
will be interpreted by the linker. */
if (s[2] == '\0')
temporary file for the LTO output. The `-o' option
will be interpreted by the linker. */
if (s[2] == '\0')
+ {
+ char *output_dir, *base, *name;
+
+ i++;
+ output_dir = xstrdup (argv[i]);
+ base = output_dir;
+ for (name = base; *name; name++)
+ if (IS_DIR_SEPARATOR (*name))
+ base = name + 1;
+ *base = '\0';
+
+ *argv_ptr++ = "-dumpbase";
+ if (*output_dir == '\0')
+ {
+ static char current_dir[] =
+ { '.', DIR_SEPARATOR, '\0' };
+ output_dir = current_dir;
+ *argv_ptr++ = argv[i];
+ }
+ else
+ *argv_ptr++ = &argv[i][base - output_dir];
+
+ *argv_ptr++ = "-dumpdir";
+ *argv_ptr++ = output_dir;
+ }
}
else
/* Pass the option or argument to LTO. */
}
else
/* Pass the option or argument to LTO. */
+2010-01-03 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR lto/41564
+ * lto.c (DUMPBASE_SUFFIX): New.
+ (lto_execute_ltrans): Append a sequence number to -dumpbase
+ for LTRANS.
+
2010-01-02 H.J. Lu <hongjiu.lu@intel.com>
PR lto/42580
2010-01-02 H.J. Lu <hongjiu.lu@intel.com>
PR lto/42580
/* Top-level LTO routines.
/* Top-level LTO routines.
- Copyright 2009 Free Software Foundation, Inc.
+ Copyright 2009, 2010 Free Software Foundation, Inc.
Contributed by CodeSourcery, Inc.
This file is part of GCC.
Contributed by CodeSourcery, Inc.
This file is part of GCC.
+/* Template of LTRANS dumpbase suffix. */
+#define DUMPBASE_SUFFIX ".ltrans18446744073709551615"
/* Perform local transformations (LTRANS) on the files in the NULL-terminated
FILES array. These should have been written previously by
/* Perform local transformations (LTRANS) on the files in the NULL-terminated
FILES array. These should have been written previously by
int err;
int status;
FILE *ltrans_output_list_stream = NULL;
int err;
int status;
FILE *ltrans_output_list_stream = NULL;
+ bool seen_dumpbase = false;
+ char *dumpbase_suffix = NULL;
timevar_push (TV_WHOPR_WPA_LTRANS_EXEC);
timevar_push (TV_WHOPR_WPA_LTRANS_EXEC);
++j;
obstack_init (&env_obstack);
obstack_grow (&env_obstack, &collect_gcc_options[i], j - i);
++j;
obstack_init (&env_obstack);
obstack_grow (&env_obstack, &collect_gcc_options[i], j - i);
- obstack_1grow (&env_obstack, 0);
+ if (seen_dumpbase)
+ obstack_grow (&env_obstack, DUMPBASE_SUFFIX,
+ sizeof (DUMPBASE_SUFFIX));
+ else
+ obstack_1grow (&env_obstack, 0);
option = XOBFINISH (&env_obstack, char *);
option = XOBFINISH (&env_obstack, char *);
+ if (seen_dumpbase)
+ {
+ dumpbase_suffix = option + 7 + j - i;
+ seen_dumpbase = false;
+ }
/* LTRANS does not need -fwpa nor -fltrans-*. */
if (strncmp (option, "-fwpa", 5) != 0
&& strncmp (option, "-fltrans-", 9) != 0)
/* LTRANS does not need -fwpa nor -fltrans-*. */
if (strncmp (option, "-fwpa", 5) != 0
&& strncmp (option, "-fltrans-", 9) != 0)
+ {
+ if (strncmp (option, "-dumpbase", 9) == 0)
+ seen_dumpbase = true;
+ *argv_ptr++ = option;
+ }
}
*argv_ptr++ = "-fltrans";
}
*argv_ptr++ = "-fltrans";
argv_ptr[2] = files[i];
argv_ptr[3] = NULL;
argv_ptr[2] = files[i];
argv_ptr[3] = NULL;
+ /* Append a sequence number to -dumpbase for LTRANS. */
+ if (dumpbase_suffix)
+ snprintf (dumpbase_suffix, sizeof (DUMPBASE_SUFFIX) - 7,
+ "%lu", (unsigned long) i);
+
/* Execute the driver. */
pex = pex_init (0, "lto1", NULL);
if (pex == NULL)
/* Execute the driver. */
pex = pex_init (0, "lto1", NULL);
if (pex == NULL)
/* Command line option handling.
/* Command line option handling.
- Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
+ Copyright (C) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010
Free Software Foundation, Inc.
Contributed by Neil Booth.
Free Software Foundation, Inc.
Contributed by Neil Booth.
handle_options (argc, argv, lang_mask);
handle_options (argc, argv, lang_mask);
- /* Make DUMP_BASE_NAME relative to the AUX_BASE_NAME directory,
- typically the directory to contain the object file. */
- if (aux_base_name && ! IS_ABSOLUTE_PATH (dump_base_name))
+ if (dump_base_name && ! IS_ABSOLUTE_PATH (dump_base_name))
- const char *aux_base;
-
- base_of_path (aux_base_name, &aux_base);
- if (aux_base_name != aux_base)
+ /* First try to make DUMP_BASE_NAME relative to the DUMP_DIR_NAME
+ directory. Then try to make DUMP_BASE_NAME relative to the
+ AUX_BASE_NAME directory, typically the directory to contain
+ the object file. */
+ if (dump_dir_name)
+ dump_base_name = concat (dump_dir_name, dump_base_name, NULL);
+ else if (aux_base_name)
- int dir_len = aux_base - aux_base_name;
- char *new_dump_base_name =
- XNEWVEC (char, strlen(dump_base_name) + dir_len + 1);
-
- /* Copy directory component from AUX_BASE_NAME. */
- memcpy (new_dump_base_name, aux_base_name, dir_len);
- /* Append existing DUMP_BASE_NAME. */
- strcpy (new_dump_base_name + dir_len, dump_base_name);
- dump_base_name = new_dump_base_name;
+ const char *aux_base;
+
+ base_of_path (aux_base_name, &aux_base);
+ if (aux_base_name != aux_base)
+ {
+ int dir_len = aux_base - aux_base_name;
+ char *new_dump_base_name =
+ XNEWVEC (char, strlen(dump_base_name) + dir_len + 1);
+
+ /* Copy directory component from AUX_BASE_NAME. */
+ memcpy (new_dump_base_name, aux_base_name, dir_len);
+ /* Append existing DUMP_BASE_NAME. */
+ strcpy (new_dump_base_name + dir_len, dump_base_name);
+ dump_base_name = new_dump_base_name;
+ }
dump_base_name = arg;
break;
dump_base_name = arg;
break;
+ case OPT_dumpdir:
+ dump_dir_name = arg;
+ break;
+
case OPT_falign_functions_:
align_functions = value;
break;
case OPT_falign_functions_:
align_functions = value;
break;
const char *dump_base_name;
const char *dump_base_name;
+/* Directory used for dump output files. */
+
+const char *dump_dir_name;
+
/* Name to use as a base for auxiliary output files. */
const char *aux_base_name;
/* Name to use as a base for auxiliary output files. */
const char *aux_base_name;
/* Ignore these. */
if (strcmp (*p, "-o") == 0
|| strcmp (*p, "-dumpbase") == 0
/* Ignore these. */
if (strcmp (*p, "-o") == 0
|| strcmp (*p, "-dumpbase") == 0
+ || strcmp (*p, "-dumpdir") == 0
|| strcmp (*p, "-auxbase") == 0)
{
if (p[1] != NULL)
|| strcmp (*p, "-auxbase") == 0)
{
if (p[1] != NULL)
/* toplev.h - Various declarations for functions found in toplev.c
/* toplev.h - Various declarations for functions found in toplev.c
- Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007, 2008,
- 2009 Free Software Foundation, Inc.
+ Copyright (C) 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006, 2007,
+ 2008, 2009, 2010
+ Free Software Foundation, Inc.
This file is part of GCC.
This file is part of GCC.
extern const char *progname;
extern const char *dump_base_name;
extern const char *progname;
extern const char *dump_base_name;
+extern const char *dump_dir_name;
extern const char *aux_base_name;
extern const char *aux_info_file_name;
extern const char *profile_data_prefix;
extern const char *aux_base_name;
extern const char *aux_info_file_name;
extern const char *profile_data_prefix;