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]

Re: Use pass manager for RTL passes 3/4: move pass manager topasses.c


> +
> +static int 
> +register_dump_files (struct tree_opt_pass *pass, bool ipa, int properties)
> +{
> +  static int n = 0;
> +  do
> +    {
> +      int new_properties;
> +      int pass_number;
> +
> +      pass->properties_required = properties;
> +      new_properties =
> +        (properties | pass->properties_provided) & ~pass->properties_destroyed;
> +
> +      /* Reset the counter when we reach RTL-based passes.  */
> +      if ((new_properties ^ pass->properties_required) & PROP_rtl)
> +        n = 0;
> +
> +      pass_number = n;
> +      if (pass->name)
> +        n++;
> +
> +      if (pass->sub)
> +        new_properties = register_dump_files (pass->sub, ipa, new_properties);
> +
> +      /* If we have a gate, combine the properties that we could have with
> +         and without the pass being examined.  */
> +      if (pass->gate)
> +        properties &= new_properties;
> +      else
> +        properties = new_properties;
> +
> +      pass->properties_provided = properties;
> +      if (pass->name)
> +        register_one_dump_file (pass, ipa, pass_number);
> +
> +      pass = pass->next;
> +    }
> +  while (pass);
> +
> +  return properties;
> +}


cvs annotate pegs you as having written this code in tree-pass.c
originally, and it recently bit me.

Why are you resetting required and provided properties on pass
structures?

I've got a pass i put PROP_cfg on (i specifically left out PROP_ssa),
and put it in the middle of the SSA, and this code (which is completely
hidden and hard to find) resets the properties provided and required to
include PROP_ssa | PROP_alias | PROP_<a few other things>

This seems completely wrong to me.
The code is only suppoesd to verify that twe have the properties
correct, not change what the user has written in his pass structure.

And even if you were going to change what the user has written in the
pass structure, "register_dump_files" is *not* the function to do it.
Maybe "update_pass_properties".

--Dan


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