Patchwork Unbreak build on mips (was Re: Passes are now C++ classes (was Re: [PATCH 03/11] Handwritten part of conversion of passes to C++ classes))

login
register
mail settings
Submitter David Malcolm
Date Aug. 6, 2013, 5:55 p.m.
Message ID <1375811745.5818.19.camel@surprise>
Download mbox | patch
Permalink /patch/265184/
State New
Headers show

Comments

David Malcolm - Aug. 6, 2013, 5:55 p.m.
On Tue, 2013-08-06 at 08:16 -0700, Steve Ellcey wrote:
> On Mon, 2013-08-05 at 17:03 -0400, David Malcolm wrote:
> 
> > Given all of the above testing I'm reasonably confident that this works.
> > However this is such a large change [1] that there's a non-zero chance
> > of at least one glitch - let me know if you see any breakages.
> 
> The mips*-*-* targets are not building.  It looks like the mips reorg
> pass (pass_mips_machine_reorg2) in config/mips/mips.c was not converted
> and/or was not converted correctly.

Sorry about this.

I was able to reproduce this build error with configure
--target=mips-linux-elf:
../../src/gcc/config/mips/mips.c:16379:28: error: expected
primary-expression before ‘.’ token

I'm attaching a patch which fixes that issue for me.  Only lightly
tested (build&host=x86_64, target as above) - I'm able to build stage1,
and cc1 appears to generate assembler on a simple test case.  I stepped
through the changed code in the debugger and it appears to do the right
thing.  However I'm not familiar with the internals of the pass in
question.
Richard Sandiford - Aug. 6, 2013, 6:11 p.m.
David Malcolm <dmalcolm@redhat.com> writes:
> commit 11d46884e8bd9802b0f528a16b3970b4076fe8a9
> Author: David Malcolm <dmalcolm@redhat.com>
> Date:   Tue Aug 6 13:48:59 2013 -0400
>
>     gcc/
>     	* config/mips/mips.c (insert_pass_mips_machine_reorg2): Move
>     	into...
>     	(mips_option_override): ...here, porting to new C++ API for
>     	passes.

OK.  Thanks for the quick fix!

Richard
David Malcolm - Aug. 6, 2013, 6:52 p.m.
On Tue, 2013-08-06 at 19:11 +0100, Richard Sandiford wrote:
> David Malcolm <dmalcolm@redhat.com> writes:
> > commit 11d46884e8bd9802b0f528a16b3970b4076fe8a9
> > Author: David Malcolm <dmalcolm@redhat.com>
> > Date:   Tue Aug 6 13:48:59 2013 -0400
> >
> >     gcc/
> >     	* config/mips/mips.c (insert_pass_mips_machine_reorg2): Move
> >     	into...
> >     	(mips_option_override): ...here, porting to new C++ API for
> >     	passes.
> 
> OK.  Thanks for the quick fix!

Thanks; committed to trunk as r201542.

Patch

commit 11d46884e8bd9802b0f528a16b3970b4076fe8a9
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Aug 6 13:48:59 2013 -0400

    gcc/
    	* config/mips/mips.c (insert_pass_mips_machine_reorg2): Move
    	into...
    	(mips_option_override): ...here, porting to new C++ API for
    	passes.

diff --git a/gcc/config/mips/mips.c b/gcc/config/mips/mips.c
index 05ba003..4da80f4 100644
--- a/gcc/config/mips/mips.c
+++ b/gcc/config/mips/mips.c
@@ -56,6 +56,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "target-globals.h"
 #include "opts.h"
 #include "tree-pass.h"
+#include "context.h"
 
 /* True if X is an UNSPEC wrapper around a SYMBOL_REF or LABEL_REF.  */
 #define UNSPEC_ADDRESS_P(X)					\
@@ -16374,13 +16375,6 @@  make_pass_mips_machine_reorg2 (gcc::context *ctxt)
   return new pass_mips_machine_reorg2 (ctxt);
 }
 
-struct register_pass_info insert_pass_mips_machine_reorg2 =
-{
-  &pass_mips_machine_reorg2.pass,	/* pass */
-  "dbr",				/* reference_pass_name */
-  1,					/* ref_pass_instance_number */
-  PASS_POS_INSERT_AFTER			/* po_op */
-};
 
 /* Implement TARGET_ASM_OUTPUT_MI_THUNK.  Generate rtl rather than asm text
    in order to avoid duplicating too much logic from elsewhere.  */
@@ -17174,6 +17168,14 @@  mips_option_override (void)
   /* We register a second machine specific reorg pass after delay slot
      filling.  Registering the pass must be done at start up.  It's
      convenient to do it here.  */
+  opt_pass *new_pass = make_pass_mips_machine_reorg2 (g);
+  struct register_pass_info insert_pass_mips_machine_reorg2 =
+    {
+      new_pass,		/* pass */
+      "dbr",			/* reference_pass_name */
+      1,			/* ref_pass_instance_number */
+      PASS_POS_INSERT_AFTER	/* po_op */
+    };
   register_pass (&insert_pass_mips_machine_reorg2);
 
   if (TARGET_HARD_FLOAT_ABI && TARGET_MIPS5900)