This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[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?
commit 126c2275e2fa0aaee13d095be04ba4e3111f2cc9
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Wed Jul 17 11:28:14 2013 -0400

    Rename troublesome IPA callback in ipa-pure-const.c
    
    gcc/
    
    	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
--- a/gcc/ipa-pure-const.c
+++ b/gcc/ipa-pure-const.c
@@ -906,7 +906,7 @@ register_hooks (void)
    CONST.  */
 
 static void
-generate_summary (void)
+pure_const_generate_summary (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 */

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]