This is the mail archive of the
mailing list for the GCC project.
[PATCH] Rename callback in ipa-pure-const.c
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Cc: dmalcolm at redhat dot com
- Date: Wed, 17 Jul 2013 21:32:29 -0400
- Subject: [PATCH] Rename callback in ipa-pure-const.c
The following trivial patch renames pass_ipa_pure_const's
generate_summary callback to something other than "generate_summary",
since this causes trouble in a patch I'm working on that converts passes
to C++ classes (the constructor gets confused in the member initializer
for generate_summary, and "initializes" it to this->generate_summary i.e
itself, rather than looking up the function named "generate_summary").
This is the only callback for a ipa_opt_pass_d in which the callback has
the same name as the field it's initializing.
I've successfully bootstrapped and tested this on
x86_64-unknown-linux-gnu: all testcases show the same results as an
unpatched build (relative to r201011).
OK to commit to trunk?
Author: David Malcolm <email@example.com>
Date: Wed Jul 17 11:28:14 2013 -0400
Rename troublesome IPA callback in ipa-pure-const.c
Avoid having a function with the same name as the corresponding
slot in ipa_opt_pass_d callbacks, since this leads to my
refactoring script creating a buggy autogenerated ctor.
* ipa-pure-const.c (generate_summary): Rename to...
(pure_const_generate_summary): ... this.
diff --git a/gcc/ipa-pure-const.c b/gcc/ipa-pure-const.c
index 9705db1..542d33a 100644
@@ -906,7 +906,7 @@ register_hooks (void)
struct cgraph_node *node;
@@ -1513,7 +1513,7 @@ struct ipa_opt_pass_d pass_ipa_pure_const =
0, /* todo_flags_start */
0 /* todo_flags_finish */
- generate_summary, /* generate_summary */
+ pure_const_generate_summary, /* generate_summary */
pure_const_write_summary, /* write_summary */
pure_const_read_summary, /* read_summary */
NULL, /* write_optimization_summary */