This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[incremental] Patch: FYI: fix lowering passes problem
- From: Tom Tromey <tromey at redhat dot com>
- To: Gcc Patch List <gcc-patches at gcc dot gnu dot org>
- Date: Wed, 12 Mar 2008 09:25:24 -0600
- Subject: [incremental] Patch: FYI: fix lowering passes problem
- Reply-to: tromey at redhat dot com
I'm checking this in on the incremental-compiler branch.
If the first pass in all_lowering_passes has a gate, and the gate says
no, then TODO_set_props will not be seen, and the compiler will ICE.
This happened when running configure in libgfortran.
This patch fixes the problem by adding a do-nothing pass which exists
simply to hold this flag.
Tom
ChangeLog:
2008-03-12 Tom Tromey <tromey@redhat.com>
* passes.c (do_nothing_but_lower): New function.
(pass_do_nothing_but_lower): New global.
(init_optimization_passes): Add pass_do_nothing_but_lower at
beginning of all_lowering_passes.
Index: passes.c
===================================================================
--- passes.c (revision 132956)
+++ passes.c (working copy)
@@ -1,6 +1,6 @@
/* Top level of GCC compilers (cc1, cc1plus, etc.)
Copyright (C) 1987, 1988, 1989, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
- 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
+ 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
Free Software Foundation, Inc.
This file is part of GCC.
@@ -325,7 +325,32 @@
};
+static unsigned int
+do_nothing_but_lower (void)
+{
+ return 0;
+}
+/* We need an initial pass for all_lowering_passes that does nothing
+ but is a place where we can hang TODO_set_props. */
+static struct tree_opt_pass pass_do_nothing_but_lower =
+{
+ "nothingbutlower", /* name */
+ NULL, /* gate */
+ do_nothing_but_lower, /* execute */
+ NULL, /* sub */
+ NULL, /* next */
+ 0, /* static_pass_number */
+ 0, /* tv_id */
+ PROP_gimple_any, /* properties_required */
+ 0, /* properties_provided */
+ 0, /* properties_destroyed */
+ 0, /* todo_flags_start */
+ TODO_dump_func, /* todo_flags_finish */
+ 0 /* letter */
+};
+
+
/* The root of the compilation pass tree, once constructed. */
struct tree_opt_pass *all_passes, *all_ipa_passes, *all_lowering_passes;
@@ -476,6 +501,7 @@
backend might produce already lowered functions that are not processed
by these passes. */
p = &all_lowering_passes;
+ NEXT_PASS (pass_do_nothing_but_lower);
if (lang_hooks.post_gimplify_pass)
NEXT_PASS (*lang_hooks.post_gimplify_pass);
NEXT_PASS (pass_diagnose_omp_blocks);