This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH 040/236] Use rtx_insn internally within generated functions
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Jeff Law <law at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Thu, 21 Aug 2014 03:47:44 -0400
- Subject: Re: [PATCH 040/236] Use rtx_insn internally within generated functions
- Authentication-results: sourceware.org; auth=none
- References: <1407345815-14551-1-git-send-email-dmalcolm at redhat dot com> <1407345815-14551-41-git-send-email-dmalcolm at redhat dot com> <53EBA868 dot 9050204 at redhat dot com>
On Wed, 2014-08-13 at 12:03 -0600, Jeff Law wrote:
> On 08/06/14 11:20, David Malcolm wrote:
> > With this patch, "insn" and "curr_insn" as used from C++ fragments in .md
> > files are strengthened from rtx to rtx_insn *, allowing numerous
> > target-specific functions to have their params be similiar strengthened.
> >
> > The top-level interfaces ("recog", "split", "peephole2") continue to take
> > a plain rtx for "insn", to avoid introducing dependencies on other
> > patches.
> >
> > gcc/
> > * recog.h (insn_output_fn): Update this function typedef to match
> > the changes below to the generated output functions, strengthening
> > the 2nd param from rtx to rtx_insn *.
> >
> > * final.c (get_insn_template): Add a checked cast to rtx_insn * on
> > insn when invoking an output function, to match the new signature
> > of insn_output_fn with a stronger second param.
> >
> > * genconditions.c (write_header): In the generated code for
> > gencondmd.c, strengthen the global "insn" from rtx to rtx_insn *
> > to match the other changes in this patch.
> >
> > * genemit.c (gen_split): Strengthen the 1st param "curr_insn" of
> > the generated "gen_" functions from rtx to rtx_insn * within their
> > implementations.
> >
> > * genrecog.c (write_subroutine): Strengthen the 2nd param "insn" of
> > the subfunctions within the generated "recog_", "split", "peephole2"
> > function trees from rtx to rtx_insn *. For now, the top-level
> > generated functions ("recog", "split", "peephole2") continue to
> > take a plain rtx for "insn", to avoid introducing dependencies on
> > other patches. Rename this 2nd param from "insn" to
> > "uncast_insn", and reintroduce "insn" as a local variable of type
> > rtx_insn *, initialized at the top of the generated function with
> > a checked cast on "uncast_insn".
> > (make_insn_sequence): Strengthen the 1st param "curr_insn" of
> > the generated "gen_" functions from rtx to rtx_insn * within their
> > prototypes.
> >
> > * genoutput.c (process_template): Strengthen the 2nd param within
> > the generated "output_" functions "insn" from rtx to rtx_insn *.
> OK.
Thanks; bootstrapped and committed to trunk as r214257, with a trivial
fixup of the as_a_nullable to safe_as_a.