Patchwork Fix broken build on sparc (was Re: [buildbot] r201508: Build failures after pass C++ conversion)

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

Comments

David Malcolm - Aug. 6, 2013, 5:39 p.m.
On Tue, 2013-08-06 at 14:12 +0200, Jan-Benedict Glaw wrote:
> On Tue, 2013-08-06 14:10:11 +0200, Jan-Benedict Glaw <jbglaw@lug-owl.de> wrote:
> > And probably also for sparc{,64}-linux:
> > 
> > g++ -c   -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE  -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../../../gcc/gcc -I../../../../gcc/gcc/. -I../../../../gcc/gcc/../include -I../../../../gcc/gcc/../libcpp/include  -I../../../../gcc/gcc/../libdecnumber -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber -I../../../../gcc/gcc/../libbacktrace    \
> >                 ../../../../gcc/gcc/config/sparc/sparc.c -o sparc.o
> > ../../../../gcc/gcc/config/sparc/sparc.c:1043:27: error: expected primary-expression before ‘.’ token
> >    &pass_work_around_errata.pass, /* pass */
> >                            ^
> 
> This was wrong, it's probably caused by r201511: "Rewrite how
> instances of passes are cloned".

I think it's r201508, but in any case, I'm attaching a patch which fixes
this build error.  Only very lightly tested so far, with configure
--target=sparc-linux with build&host x86_64.  Was able to build a cc1
and step through the changed code in the debugger, though am getting
"cc1: error: no include path in which to search for stdc-predef.h"
Eric Botcazou - Aug. 7, 2013, 1:25 p.m.
> I think it's r201508, but in any case, I'm attaching a patch which fixes
> this build error.  Only very lightly tested so far, with configure
> --target=sparc-linux with build&host x86_64.  Was able to build a cc1
> and step through the changed code in the debugger, though am getting
> "cc1: error: no include path in which to search for stdc-predef.h"

Looks good, please install if not already done.
David Malcolm - Aug. 7, 2013, 3:49 p.m.
On Wed, 2013-08-07 at 15:25 +0200, Eric Botcazou wrote:
> Looks good, please install if not already done.
Thanks; I've now committed this to trunk as r201569.

Patch

commit 8abbe9fbce66bdb1b03281fc06bc86707b5b3cf6
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Tue Aug 6 13:32:32 2013 -0400

    gcc/
    	* config/sparc/sparc.c (insert_pass_work_around_errata): Move
    	into...
    	(sparc_option_override): ...and port to new C++ pass API.
    	* config/sparc/t-sparc (sparc.o): Add dep on CONTEXT_H

diff --git a/gcc/config/sparc/sparc.c b/gcc/config/sparc/sparc.c
index 66c33f7..7080b33 100644
--- a/gcc/config/sparc/sparc.c
+++ b/gcc/config/sparc/sparc.c
@@ -53,6 +53,7 @@  along with GCC; see the file COPYING3.  If not see
 #include "df.h"
 #include "opts.h"
 #include "tree-pass.h"
+#include "context.h"
 
 /* Processor costs */
 
@@ -1038,14 +1039,6 @@  make_pass_work_around_errata (gcc::context *ctxt)
   return new pass_work_around_errata (ctxt);
 }
 
-struct register_pass_info insert_pass_work_around_errata =
-{
-  &pass_work_around_errata.pass,	/* pass */
-  "dbr",				/* reference_pass_name */
-  1,					/* ref_pass_instance_number */
-  PASS_POS_INSERT_AFTER			/* po_op */
-};
-
 /* Helpers for TARGET_DEBUG_OPTIONS.  */
 static void
 dump_target_flag_bits (const int flags)
@@ -1495,6 +1488,14 @@  sparc_option_override (void)
      (essentially) final form of the insn stream to work on.
      Registering the pass must be done at start up.  It's convenient to
      do it here.  */
+  opt_pass *errata_pass = make_pass_work_around_errata (g);
+  struct register_pass_info insert_pass_work_around_errata =
+    {
+      errata_pass,		/* pass */
+      "dbr",			/* reference_pass_name */
+      1,			/* ref_pass_instance_number */
+      PASS_POS_INSERT_AFTER	/* po_op */
+    };
   register_pass (&insert_pass_work_around_errata);
 }
 
diff --git a/gcc/config/sparc/t-sparc b/gcc/config/sparc/t-sparc
index 664f4a4..62ad3f7 100644
--- a/gcc/config/sparc/t-sparc
+++ b/gcc/config/sparc/t-sparc
@@ -24,7 +24,7 @@  sparc.o: $(CONFIG_H) $(SYSTEM_H) coretypes.h $(TM_H) \
   $(FUNCTION_H) $(EXCEPT_H) $(EXPR_H) $(OPTABS_H) $(RECOG_H) \
   $(DIAGNOSTIC_CORE_H) $(GGC_H) $(TM_P_H) debug.h $(TARGET_H) \
   $(TARGET_DEF_H) $(COMMON_TARGET_H) $(GIMPLE_H) $(TREE_PASS_H) \
-  langhooks.h reload.h $(PARAMS_H) $(DF_H) $(OPTS_H) \
+  langhooks.h reload.h $(PARAMS_H) $(DF_H) $(OPTS_H) $(CONTEXT_H) \
   gt-sparc.h
 
 sparc-c.o: $(srcdir)/config/sparc/sparc-c.c \