This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug tree-optimization/36291] GCC is slow and memory-hungry building sipQtGuipart.cpp
- From: "rguenth at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 22 May 2008 12:48:27 -0000
- Subject: [Bug tree-optimization/36291] GCC is slow and memory-hungry building sipQtGuipart.cpp
- References: <bug-36291-10053@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Comment #3 from rguenth at gcc dot gnu dot org 2008-05-22 12:48 -------
The root of all evil is the following code in add_referenced_var():
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
variables.
Even non-constant intializers need to be walked, because
IPA passes might prove that their are invariant later on. */
if (DECL_INITIAL (var)
/* Initializers of external variables are not useful to the
optimizers. */
&& !DECL_EXTERNAL (var))
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
this causes us to basically add all globals to all functions referenced
vars once they reference one of the chained structs.
We shouldn't be doing this but instead who needs those vars should add them.
I suppose the IPA passes thing is just the lack of a global DECL_UID to
tree mapping. So I am going to try to change the above to
/* Scan DECL_INITIAL for pointer variables as they may contain
address arithmetic referencing the address of other
variables. As we are only interested in directly referenced
globals or referenced locals restrict this to initializers
than can refer to local variables. */
if (DECL_INITIAL (var)
&& DECL_CONTEXT (var) == current_function_decl)
walk_tree (&DECL_INITIAL (var), find_vars_r, NULL, 0);
This gets memory usage down to about 700MB and compile time down to 50s.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hubicka at gcc dot gnu dot
| |org
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Last reconfirmed|0000-00-00 00:00:00 |2008-05-22 12:48:27
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36291