Commit bbbe4e7b by Paolo Bonzini Committed by Paolo Bonzini

passes.c (register_one_dump_file): Accept the current properties instead of pass number.

2006-02-08  Paolo Bonzini  <bonzini@gnu.org>

	* passes.c (register_one_dump_file): Accept the current properties
	instead of pass number.  Adjust call to dump_register.  Remove
	duplicated code.
	(register_dump_files): Now a wrapper around...
	(register_dump_files_1): ... this one.  Do not modify the pass
	structure.
	(next_pass_1): Cosmetic fix.
	(execute_todo): Keep second parameter only.  Use curr_properties instead
	of fetching it from the pass structure.  Check and set last_verified.
	(execute_one_pass): Handle TODO_set_props.  Use curr_properties
	instead of fetching it from the pass structure.  Fix calls to
	execute_todo.  Update curr_properties and initialize .vcg RTL dump
	after running the pass.  Reset last_verified.
	* tree-dump.c (dump_files): Renumber consecutively.  Put .cgraph dump
	at the beginning.
	(FIRST_AUTO_NUMBERED_DUMP): New.
	(dump_register): Remove "num" parameter, assign it within the
	function.
	(get_dump_file_name): Modify template for dumps.
	* tree-dump.h (dump_register): Adjust prototype.
	* tree-pass.h (enum tree_dump_index): Move cgraph at the beginning.
	(PROP_trees): Add PROP_gimple_lomp.
	(TODO_set_props): New.
        * gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf.
        * tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh.
        * cfgexpand.c (pass_expand): Destroy PROP_trees.

gcc/testsuite:
2006-02-08  Paolo Bonzini  <bonzini@gnu.org>

	* lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
	cleanup-ipa-dump): Update dump file glob patterns.
	* lib/scantree.exp (scan-tree-dump, scan-tree-dump-times,
	scan-tree-dump-not, scan-tree-dump-dem): Likewise.
	* lib/scanipa.exp (scan-ipa-dump, scan-ipa-dump-times,
	scan-ipa-dump-not, scan-ipa-dump-dem): Likewise.

	* lib/scanrtl.exp: New.
	* lib/gcc-dg.exp: Load it.
	* objc.dg/stubify-2.m: Use scan-rtl-dump-not.

From-SVN: r110742
parent fbf2ca7b
2006-02-08 Paolo Bonzini <bonzini@gnu.org>
* passes.c (register_one_dump_file): Accept the current properties
instead of pass number. Adjust call to dump_register. Remove
duplicated code.
(register_dump_files): Now a wrapper around...
(register_dump_files_1): ... this one. Do not modify the pass
structure.
(next_pass_1): Cosmetic fix.
(execute_todo): Keep second parameter only. Use curr_properties instead
of fetching it from the pass structure. Check and set last_verified.
(execute_one_pass): Handle TODO_set_props. Use curr_properties
instead of fetching it from the pass structure. Fix calls to
execute_todo. Update curr_properties and initialize .vcg RTL dump
after running the pass. Reset last_verified.
* tree-dump.c (dump_files): Renumber consecutively. Put .cgraph dump
at the beginning.
(FIRST_AUTO_NUMBERED_DUMP): New.
(dump_register): Remove "num" parameter, assign it within the
function.
(get_dump_file_name): Modify template for dumps.
* tree-dump.h (dump_register): Adjust prototype.
* tree-pass.h (enum tree_dump_index): Move cgraph at the beginning.
(PROP_trees): Add PROP_gimple_lomp.
(TODO_set_props): New.
* gimple-low.c (pass_lower_cf): Do not destroy PROP_gimple_lcf.
* tree-eh.c (pass_lower_eh): Do not destroy PROP_gimple_leh.
* cfgexpand.c (pass_expand): Destroy PROP_trees.
2006-02-08 Jakub Jelinek <jakub@redhat.com> 2006-02-08 Jakub Jelinek <jakub@redhat.com>
* config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file. * config.gcc (sparc-*-linux*): Add sparc/t-linux to tmake_file.
......
...@@ -1699,7 +1699,7 @@ struct tree_opt_pass pass_expand = ...@@ -1699,7 +1699,7 @@ struct tree_opt_pass pass_expand =
/* ??? If TER is enabled, we actually receive GENERIC. */ /* ??? If TER is enabled, we actually receive GENERIC. */
PROP_gimple_leh | PROP_cfg, /* properties_required */ PROP_gimple_leh | PROP_cfg, /* properties_required */
PROP_rtl, /* properties_provided */ PROP_rtl, /* properties_provided */
PROP_gimple_leh, /* properties_destroyed */ PROP_trees, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_dump_func, /* todo_flags_finish */ TODO_dump_func, /* todo_flags_finish */
'r' /* letter */ 'r' /* letter */
......
...@@ -131,7 +131,7 @@ struct tree_opt_pass pass_lower_cf = ...@@ -131,7 +131,7 @@ struct tree_opt_pass pass_lower_cf =
0, /* tv_id */ 0, /* tv_id */
PROP_gimple_any, /* properties_required */ PROP_gimple_any, /* properties_required */
PROP_gimple_lcf, /* properties_provided */ PROP_gimple_lcf, /* properties_provided */
PROP_gimple_any, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_dump_func, /* todo_flags_finish */ TODO_dump_func, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
......
2006-02-08 Paolo Bonzini <bonzini@gnu.org>
* lib/gcc-dg.exp (cleanup-rtl-dump, cleanup-tree-dump,
cleanup-ipa-dump): Update dump file glob patterns.
* lib/scantree.exp (scan-tree-dump, scan-tree-dump-times,
scan-tree-dump-not, scan-tree-dump-dem): Likewise.
* lib/scanipa.exp (scan-ipa-dump, scan-ipa-dump-times,
scan-ipa-dump-not, scan-ipa-dump-dem): Likewise.
* lib/scanrtl.exp: New.
* lib/gcc-dg.exp: Load it.
* objc.dg/stubify-2.m: Use scan-rtl-dump-not.
2006-02-07 Janis Johnson <janis187@us.ibm.com> 2006-02-07 Janis Johnson <janis187@us.ibm.com>
PR testsuite/26159 PR testsuite/26159
# Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005 Free Software Foundation, Inc. # Copyright (C) 1997, 1999, 2000, 2003, 2004, 2005, 2006
# Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify # This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
...@@ -19,6 +20,7 @@ load_lib file-format.exp ...@@ -19,6 +20,7 @@ load_lib file-format.exp
load_lib target-supports.exp load_lib target-supports.exp
load_lib target-supports-dg.exp load_lib target-supports-dg.exp
load_lib scanasm.exp load_lib scanasm.exp
load_lib scanrtl.exp
load_lib scantree.exp load_lib scantree.exp
load_lib scanipa.exp load_lib scanipa.exp
load_lib prune.exp load_lib prune.exp
...@@ -344,21 +346,21 @@ proc cleanup-repo-files { } { ...@@ -344,21 +346,21 @@ proc cleanup-repo-files { } {
# #
# SUFFIX is the filename suffix pattern. # SUFFIX is the filename suffix pattern.
proc cleanup-rtl-dump { suffix } { proc cleanup-rtl-dump { suffix } {
cleanup-dump "\[0-9\]\*.$suffix" cleanup-dump "\[0-9\]\[0-9\]\[0-9\]r.$suffix"
} }
# Remove a specific tree dump file for the current test. # Remove a specific tree dump file for the current test.
# #
# SUFFIX is the tree dump file suffix pattern. # SUFFIX is the tree dump file suffix pattern.
proc cleanup-tree-dump { suffix } { proc cleanup-tree-dump { suffix } {
cleanup-dump "t\[0-9\]\*.$suffix" cleanup-dump "\[0-9\]\[0-9\]\[0-9\]t.$suffix"
} }
# Remove a specific ipa dump file for the current test. # Remove a specific ipa dump file for the current test.
# #
# SUFFIX is the ipa dump file suffix pattern. # SUFFIX is the ipa dump file suffix pattern.
proc cleanup-ipa-dump { suffix } { proc cleanup-ipa-dump { suffix } {
cleanup-dump "i\[0-9\]\*.$suffix" cleanup-dump "\[0-9\]\[0-9\]\[0-9\]i.$suffix"
} }
# Remove all dump files with the provided suffix. # Remove all dump files with the provided suffix.
......
...@@ -36,9 +36,9 @@ proc scan-ipa-dump { args } { ...@@ -36,9 +36,9 @@ proc scan-ipa-dump { args } {
return return
} }
if { [llength $args] >= 3 } { if { [llength $args] >= 3 } {
scan-dump "ipa" [lindex $args 0] "i\[0-9\]\*.[lindex $args 1]" [lindex $args 2] scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
} else { } else {
scan-dump "ipa" [lindex $args 0] "i\[0-9\]\*.[lindex $args 1]" scan-dump "ipa" [lindex $args 0] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
} }
} }
...@@ -59,10 +59,10 @@ proc scan-ipa-dump-times { args } { ...@@ -59,10 +59,10 @@ proc scan-ipa-dump-times { args } {
} }
if { [llength $args] >= 4 } { if { [llength $args] >= 4 } {
scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \ scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
"i\[0-9\]\*.[lindex $args 2]" [lindex $args 3] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]" [lindex $args 3]
} else { } else {
scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \ scan-dump-times "ipa" [lindex $args 0] [lindex $args 1] \
"i\[0-9\]\*.[lindex $args 2]" "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 2]"
} }
} }
...@@ -83,10 +83,10 @@ proc scan-ipa-dump-not { args } { ...@@ -83,10 +83,10 @@ proc scan-ipa-dump-not { args } {
} }
if { [llength $args] >= 3 } { if { [llength $args] >= 3 } {
scan-dump-not "ipa" [lindex $args 0] \ scan-dump-not "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" [lindex $args 2] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
} else { } else {
scan-dump-not "ipa" [lindex $args 0] \ scan-dump-not "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
} }
} }
...@@ -108,10 +108,10 @@ proc scan-ipa-dump-dem { args } { ...@@ -108,10 +108,10 @@ proc scan-ipa-dump-dem { args } {
} }
if { [llength $args] >= 3 } { if { [llength $args] >= 3 } {
scan-dump-dem "ipa" [lindex $args 0] \ scan-dump-dem "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" [lindex $args 2] "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" [lindex $args 2]
} else { } else {
scan-dump-dem "ipa" [lindex $args 0] \ scan-dump-dem "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
} }
} }
...@@ -132,10 +132,10 @@ proc scan-ipa-dump-dem-not { args } { ...@@ -132,10 +132,10 @@ proc scan-ipa-dump-dem-not { args } {
} }
if { [llength $args] >= 3 } { if { [llength $args] >= 3 } {
scan-dump-dem-not "ipa" [lindex $args 0] \ scan-dump-dem-not "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" \ "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]" \
[lindex $args 2] [lindex $args 2]
} else { } else {
scan-dump-dem-not "ipa" [lindex $args 0] \ scan-dump-dem-not "ipa" [lindex $args 0] \
"i\[0-9\]\*.[lindex $args 1]" "\[0-9\]\[0-9\]\[0-9\]i.[lindex $args 1]"
} }
} }
...@@ -28,4 +28,4 @@ extern int bogonic (int, int, int) ; ...@@ -28,4 +28,4 @@ extern int bogonic (int, int, int) ;
/* Any symbol_ref of an un-stubified objc_msgSend is an error; look /* Any symbol_ref of an un-stubified objc_msgSend is an error; look
for "objc_msgSend" in quotes, without the $stub suffix. */ for "objc_msgSend" in quotes, without the $stub suffix. */
/* { dg-final { scan-file-not stubify-2.m.08.jump "symbol_ref.*\"objc_msgSend\"" } } */ /* { dg-final { scan-rtl-dump-not "symbol_ref.*\"objc_msgSend\"" "jump" } } */
...@@ -721,22 +721,23 @@ dump_node (tree t, int flags, FILE *stream) ...@@ -721,22 +721,23 @@ dump_node (tree t, int flags, FILE *stream)
/* Table of tree dump switches. This must be consistent with the /* Table of tree dump switches. This must be consistent with the
TREE_DUMP_INDEX enumeration in tree.h */ TREE_DUMP_INDEX enumeration in tree.h. */
static struct dump_file_info dump_files[TDI_end] = static struct dump_file_info dump_files[TDI_end] =
{ {
{NULL, NULL, NULL, 0, 0, 0, 0}, {NULL, NULL, NULL, 0, 0, 0, 0},
{".tu", "translation-unit", NULL, TDF_TREE, 0, 0, 0}, {".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0, 0},
{".class", "class-hierarchy", NULL, TDF_TREE, 0, 1, 0}, {".tu", "translation-unit", NULL, TDF_TREE, 0, 1, 0},
{".original", "tree-original", NULL, TDF_TREE, 0, 2, 0}, {".class", "class-hierarchy", NULL, TDF_TREE, 0, 2, 0},
{".gimple", "tree-gimple", NULL, TDF_TREE, 0, 3, 0}, {".original", "tree-original", NULL, TDF_TREE, 0, 3, 0},
{".nested", "tree-nested", NULL, TDF_TREE, 0, 4, 0}, {".gimple", "tree-gimple", NULL, TDF_TREE, 0, 4, 0},
{".inlined", "tree-inlined", NULL, TDF_TREE, 0, 5, 0}, {".nested", "tree-nested", NULL, TDF_TREE, 0, 5, 0},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 6, 0}, {".inlined", "tree-inlined", NULL, TDF_TREE, 0, 6, 0},
{".vcg", "tree-vcg", NULL, TDF_TREE, 0, 7, 0},
#define FIRST_AUTO_NUMBERED_DUMP 8
{NULL, "tree-all", NULL, TDF_TREE, 0, 0, 0}, {NULL, "tree-all", NULL, TDF_TREE, 0, 0, 0},
{NULL, "rtl-all", NULL, TDF_RTL, 0, 0, 0}, {NULL, "rtl-all", NULL, TDF_RTL, 0, 0, 0},
{NULL, "ipa-all", NULL, TDF_IPA, 0, 0, 0}, {NULL, "ipa-all", NULL, TDF_IPA, 0, 0, 0},
{ ".cgraph", "ipa-cgraph", NULL, TDF_IPA, 0, 0, 0},
}; };
/* Dynamically registered tree dump files and switches. */ /* Dynamically registered tree dump files and switches. */
...@@ -772,8 +773,11 @@ static const struct dump_option_value_info dump_options[] = ...@@ -772,8 +773,11 @@ static const struct dump_option_value_info dump_options[] =
unsigned int unsigned int
dump_register (const char *suffix, const char *swtch, const char *glob, dump_register (const char *suffix, const char *swtch, const char *glob,
int flags, unsigned int num, int letter) int flags, int letter)
{ {
static int next_dump = FIRST_AUTO_NUMBERED_DUMP;
int num = next_dump++;
size_t this = extra_dump_files_in_use++; size_t this = extra_dump_files_in_use++;
if (this >= extra_dump_files_alloced) if (this >= extra_dump_files_alloced)
...@@ -819,7 +823,7 @@ get_dump_file_info (enum tree_dump_index phase) ...@@ -819,7 +823,7 @@ get_dump_file_info (enum tree_dump_index phase)
char * char *
get_dump_file_name (enum tree_dump_index phase) get_dump_file_name (enum tree_dump_index phase)
{ {
char dump_id[7]; char dump_id[10];
struct dump_file_info *dfi; struct dump_file_info *dfi;
if (phase == TDI_none) if (phase == TDI_none)
...@@ -833,15 +837,15 @@ get_dump_file_name (enum tree_dump_index phase) ...@@ -833,15 +837,15 @@ get_dump_file_name (enum tree_dump_index phase)
dump_id[0] = '\0'; dump_id[0] = '\0';
else else
{ {
const char *template; char suffix;
if (dfi->flags & TDF_TREE) if (dfi->flags & TDF_TREE)
template = ".t%02d"; suffix = 't';
else if (dfi->flags & TDF_IPA) else if (dfi->flags & TDF_IPA)
template = ".i%02d"; suffix = 'i';
else else
template = ".%02d"; suffix = 'r';
if (snprintf (dump_id, sizeof (dump_id), template, dfi->num) < 0) if (snprintf (dump_id, sizeof (dump_id), ".%03d%c", dfi->num, suffix) < 0)
dump_id[0] = '\0'; dump_id[0] = '\0';
} }
......
...@@ -95,6 +95,7 @@ extern void debug_function (tree, int); ...@@ -95,6 +95,7 @@ extern void debug_function (tree, int);
extern int dump_flag (dump_info_p, int, tree); extern int dump_flag (dump_info_p, int, tree);
extern unsigned int dump_register (const char *, const char *, const char *, extern unsigned int dump_register (const char *, const char *, const char *,
int, unsigned int, int); int, int);
#endif /* ! GCC_TREE_DUMP_H */ #endif /* ! GCC_TREE_DUMP_H */
...@@ -1700,7 +1700,7 @@ struct tree_opt_pass pass_lower_eh = ...@@ -1700,7 +1700,7 @@ struct tree_opt_pass pass_lower_eh =
TV_TREE_EH, /* tv_id */ TV_TREE_EH, /* tv_id */
PROP_gimple_lcf, /* properties_required */ PROP_gimple_lcf, /* properties_required */
PROP_gimple_leh, /* properties_provided */ PROP_gimple_leh, /* properties_provided */
PROP_gimple_lcf, /* properties_destroyed */ 0, /* properties_destroyed */
0, /* todo_flags_start */ 0, /* todo_flags_start */
TODO_dump_func, /* todo_flags_finish */ TODO_dump_func, /* todo_flags_finish */
0 /* letter */ 0 /* letter */
......
...@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA. */ ...@@ -30,6 +30,7 @@ Boston, MA 02110-1301, USA. */
enum tree_dump_index enum tree_dump_index
{ {
TDI_none, /* No dump */ TDI_none, /* No dump */
TDI_cgraph, /* dump function call graph. */
TDI_tu, /* dump the whole translation unit. */ TDI_tu, /* dump the whole translation unit. */
TDI_class, /* dump class hierarchy. */ TDI_class, /* dump class hierarchy. */
TDI_original, /* dump each function before optimizing it */ TDI_original, /* dump each function before optimizing it */
...@@ -43,7 +44,6 @@ enum tree_dump_index ...@@ -43,7 +44,6 @@ enum tree_dump_index
TDI_rtl_all, /* enable all the RTL dumps. */ TDI_rtl_all, /* enable all the RTL dumps. */
TDI_ipa_all, /* enable all the IPA dumps. */ TDI_ipa_all, /* enable all the IPA dumps. */
TDI_cgraph, /* dump function call graph. */
TDI_end TDI_end
}; };
...@@ -154,7 +154,7 @@ struct dump_file_info ...@@ -154,7 +154,7 @@ struct dump_file_info
#define PROP_gimple_lomp (1 << 10) /* lowered OpenMP directives */ #define PROP_gimple_lomp (1 << 10) /* lowered OpenMP directives */
#define PROP_trees \ #define PROP_trees \
(PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh) (PROP_gimple_any | PROP_gimple_lcf | PROP_gimple_leh | PROP_gimple_lomp)
/* To-do flags. */ /* To-do flags. */
#define TODO_dump_func (1 << 0) #define TODO_dump_func (1 << 0)
...@@ -208,6 +208,10 @@ struct dump_file_info ...@@ -208,6 +208,10 @@ struct dump_file_info
the memory footprint for VAR_DECLs. */ the memory footprint for VAR_DECLs. */
#define TODO_remove_unused_locals (1 << 11) #define TODO_remove_unused_locals (1 << 11)
/* Internally used for the first in a sequence of passes. It is set
for the passes that are handed to register_dump_files. */
#define TODO_set_props (1 << 12)
#define TODO_update_ssa_any \ #define TODO_update_ssa_any \
(TODO_update_ssa \ (TODO_update_ssa \
| TODO_update_ssa_no_phi \ | TODO_update_ssa_no_phi \
......
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