This is the mail archive of the
mailing list for the GCC project.
Re: [PATCH 4/6] Handwritten part of conversion of passes to instances of C++ classes
- From: David Malcolm <dmalcolm at redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Fri, 26 Apr 2013 12:04:25 -0400
- Subject: Re: [PATCH 4/6] Handwritten part of conversion of passes to instances of C++ classes
- References: <1365087283 dot 1778 dot 35 dot camel at surprise> <1366420982-1546-1-git-send-email-dmalcolm at redhat dot com> <1366420982-1546-5-git-send-email-dmalcolm at redhat dot com>
On Fri, 2013-04-19 at 21:23 -0400, David Malcolm wrote:
> This is the hand-written part of the patch; it is required for the
> preceding auto-generated patch to make sense.
[Answering my own patch]
This patch isn't yet good enough as-is: upon investigating test case
failures I found that the patch wasn't properly handling instances of
passes, leading to the symptom of:
cc1plus: error: unrecognized command line option '-fdump-tree-fre1'
which was because both of the instances of "fre" were erroneously
getting the dump switch '-fdump-tree-fre' (i.e. missing the trailing
This highlighted a deeper issue with converting the passes to C++
classes: register_pass expects a pre-allocated pass, but potentially
needs to create multiple copies of the pass if it's going to be inserted
in multiple places, and gcc/passes.c:make_pass_instance creates these
instances using a memcpy with a fixed size (based on the pass type). If
we're going to support hanging extra data off of a pass instance, it
means a small reorganization here.
I'm working on a revised patch series which respects the status quo as
per -fdump- option names, and which changes register_pass so that you
pass in a callback for creating passes, rather than creating the pass