Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-08 Thread Eric Botcazou
 Sorry.  How does the attached look?  (am bootstrapping now)

Thanks for devising the patch.  However, we are in the process of fixing the 
issue on the Ada side so please do not apply it for now.

-- 
Eric Botcazou


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-08 Thread Eric Botcazou
 This break Ada.

Fixed thusly, bootstrapped and regtested on x86_64-suse-linux, applied.


2013-08-08  Eric Botcazou  ebotca...@adacore.com

* gcc-interface/Makefile.in (TOOLS_LIBS): Pick C object files from the
compiler build and use standard library variables.
(../../vxaddr2line$(exeext): Do not depend on targext.o and adjust.
(gnatmake-re): Do not depend on targext.o.
(gnatlink-re): Do not depend on link.o and targext.o.
(../../gnatmake$(exeext): Likewise.
(../../gnatlink$(exeext): Likewise.


-- 
Eric Botcazou
Index: gcc-interface/Makefile.in
===
--- gcc-interface/Makefile.in	(revision 201177)
+++ gcc-interface/Makefile.in	(working copy)
@@ -250,10 +250,9 @@ LIBS = $(LIBINTL) $(LIBICONV) $(LIBBACKT
 LIBDEPS = $(LIBINTL_DEP) $(LIBICONV_DEP) $(LIBBACKTRACE) $(LIBIBERTY)
 # Default is no TGT_LIB; one might be passed down or something
 TGT_LIB =
-TOOLS_LIBS = targext.o link.o ../../ggc-none.o ../../libcommon-target.a \
+TOOLS_LIBS = ../link.o ../targext.o ../../ggc-none.o ../../libcommon-target.a \
   ../../libcommon.a ../../../libcpp/libcpp.a $(LIBGNAT) $(LIBINTL) $(LIBICONV) \
-  ../../../libbacktrace/.libs/libbacktrace.a ../../../libiberty/libiberty.a \
-  $(SYSLIBS) $(TGT_LIB)
+  ../$(LIBBACKTRACE) ../$(LIBIBERTY) $(SYSLIBS) $(TGT_LIB)
 
 # Convert the target variable into a space separated list of architecture,
 # manufacturer, and operating system and assign each of those to its own
@@ -2491,12 +2490,12 @@ common-tools: ../stamp-tools
 	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatdll
 	$(GNATLINK) -v gnatdll -o $@ --GCC=$(GCC_LINK) $(TOOLS_LIBS)
 
-../../vxaddr2line$(exeext): ../stamp-tools targext.o
+../../vxaddr2line$(exeext): ../stamp-tools
 	$(GNATMAKE) -c  $(ADA_INCLUDES) vxaddr2line --GCC=$(CC) $(ALL_ADAFLAGS)
 	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) vxaddr2line
-	$(GNATLINK) -v vxaddr2line -o $@ --GCC=$(GCC_LINK) targext.o $(CLIB)
+	$(GNATLINK) -v vxaddr2line -o $@ --GCC=$(GCC_LINK) ../targext.o $(CLIB)
 
-gnatmake-re: ../stamp-tools link.o targext.o
+gnatmake-re: ../stamp-tools
 	$(GNATMAKE) -j0 $(ADA_INCLUDES) -u sdefault --GCC=$(CC) $(MOST_ADA_FLAGS)
 	$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatmake --GCC=$(CC) $(ALL_ADAFLAGS)
 	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatmake
@@ -2507,7 +2506,7 @@ gnatmake-re: ../stamp-tools link.o targe
 # with the former version of gnatlink itself which cannot override itself.
 # gnatlink-re cannot be run at the same time as gnatmake-re, hence the
 # dependency
-gnatlink-re: ../stamp-tools link.o targext.o gnatmake-re
+gnatlink-re: ../stamp-tools gnatmake-re
 	$(GNATMAKE) -j0 -c $(ADA_INCLUDES) gnatlink --GCC=$(CC) $(ALL_ADAFLAGS)
 	$(GNATBIND) $(ADA_INCLUDES) $(GNATBIND_FLAGS) gnatlink
 	$(GNATLINK) -v gnatlink -o ../../gnatlinknew$(exeext) \
@@ -2519,11 +2518,11 @@ gnatlink-re: ../stamp-tools link.o targe
 #  stamp target in the parent directory whenever gnat1 is rebuilt
 
 # Likewise for the tools
-../../gnatmake$(exeext): $(P) b_gnatm.o link.o targext.o $(GNATMAKE_OBJS)
+../../gnatmake$(exeext): $(P) b_gnatm.o $(GNATMAKE_OBJS)
 	+$(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatm.o $(GNATMAKE_OBJS) \
 		$(TOOLS_LIBS)
 
-../../gnatlink$(exeext): $(P) b_gnatl.o link.o targext.o $(GNATLINK_OBJS)
+../../gnatlink$(exeext): $(P) b_gnatl.o $(GNATLINK_OBJS)
 	+$(GCC_LINK) $(ALL_CFLAGS) $(LDFLAGS) -o $@ b_gnatl.o $(GNATLINK_OBJS) \
 		$(TOOLS_LIBS)
 


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-08 Thread David Malcolm
On Thu, 2013-08-08 at 16:36 +0200, Eric Botcazou wrote:
  This break Ada.
 
 Fixed thusly, bootstrapped and regtested on x86_64-suse-linux, applied.

Thanks; sorry again about the breakage.



Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-08 Thread Jan-Benedict Glaw
On Thu, 2013-08-08 10:43:53 -0400, David Malcolm dmalc...@redhat.com wrote:
 On Thu, 2013-08-08 at 16:36 +0200, Eric Botcazou wrote:
   This break Ada.
  
  Fixed thusly, bootstrapped and regtested on x86_64-suse-linux, applied.
 
 Thanks; sorry again about the breakage.

Build Robot (http://toolchain.lug-owl.de/buildbot/) looks quite fine,
too. Thanks for fixing it that fast!

This was quite a major and intrusive change, so fallout is probably
somewhat expected.  It's probably even more a question of how it is
handled afterwards, and I guess this was quite fine.

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
Signature of:  What we do for ourselves dies with us. What we do for
the second  : others and the world remains and is immortal. (Albert 
Pine)


signature.asc
Description: Digital signature


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-07 Thread Andreas Schwab
David Malcolm dmalc...@redhat.com writes:

 diff --git a/gcc/coretypes.h b/gcc/coretypes.h
 index edb9c8c..54bfe7f 100644
 --- a/gcc/coretypes.h
 +++ b/gcc/coretypes.h
 @@ -169,6 +169,12 @@ typedef const struct basic_block_def *const_basic_block;
 in target.h.  */
  typedef int reg_class_t;
  
 +class rtl_opt_pass;
 +
 +namespace gcc {
 +  class context;
 +}
 +

This break Ada.

../../xgcc -B../../ -c -DIN_GCC  -DUSE_LIBUNWIND_EXCEPTIONS -O2 -g -W -Wall  \
-iquote /usr/local/gcc/gcc-20130807/gcc \
 -iquote . -iquote .. -iquote ../.. -iquote 
/usr/local/gcc/gcc-20130807/gcc/ada -iquote /usr/local/gcc/gcc-20130807/gcc 
-I/usr/local/gcc/gcc-20130807/gcc/../include 
-I/usr/local/gcc/gcc-20130807/Build/./gmp -I/usr/local/gcc/gcc-20130807/gmp 
-I/usr/local/gcc/gcc-20130807/Build/./mpfr -I/usr/local/gcc/gcc-20130807/mpfr 
-I/usr/local/gcc/gcc-20130807/mpc/src  \
../rts/targext.c -o targext.o
In file included from ../rts/targext.c:45:0:
/usr/local/gcc/gcc-20130807/gcc/coretypes.h:172:1: error: unknown type name 
'class'
 class rtl_opt_pass;
 ^
/usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:1: error: unknown type name 
'namespace'
 namespace gcc {
 ^
/usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:15: error: expected '=', ',', 
';', 'asm' or '__attribute__' before '{' token
 namespace gcc {
   ^
make[3]: *** [targext.o] Error 1

Andreas.

-- 
Andreas Schwab, SUSE Labs, sch...@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
And now for something completely different.


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

2013-08-07 Thread Eric Botcazou
 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 buildhost 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.

-- 
Eric Botcazou


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

2013-08-07 Thread David Malcolm
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.



Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-07 Thread David Malcolm
On Wed, 2013-08-07 at 09:01 +0200, Andreas Schwab wrote:
 David Malcolm dmalc...@redhat.com writes:
 
  diff --git a/gcc/coretypes.h b/gcc/coretypes.h
  index edb9c8c..54bfe7f 100644
  --- a/gcc/coretypes.h
  +++ b/gcc/coretypes.h
  @@ -169,6 +169,12 @@ typedef const struct basic_block_def 
  *const_basic_block;
  in target.h.  */
   typedef int reg_class_t;
   
  +class rtl_opt_pass;
  +
  +namespace gcc {
  +  class context;
  +}
  +
 
 This break Ada.
 
 ../../xgcc -B../../ -c -DIN_GCC  -DUSE_LIBUNWIND_EXCEPTIONS -O2 -g -W -Wall  \
   -iquote /usr/local/gcc/gcc-20130807/gcc \
-iquote . -iquote .. -iquote ../.. -iquote 
 /usr/local/gcc/gcc-20130807/gcc/ada -iquote /usr/local/gcc/gcc-20130807/gcc 
 -I/usr/local/gcc/gcc-20130807/gcc/../include 
 -I/usr/local/gcc/gcc-20130807/Build/./gmp -I/usr/local/gcc/gcc-20130807/gmp 
 -I/usr/local/gcc/gcc-20130807/Build/./mpfr -I/usr/local/gcc/gcc-20130807/mpfr 
 -I/usr/local/gcc/gcc-20130807/mpc/src  \
   ../rts/targext.c -o targext.o
 In file included from ../rts/targext.c:45:0:
 /usr/local/gcc/gcc-20130807/gcc/coretypes.h:172:1: error: unknown type name 
 'class'
  class rtl_opt_pass;
  ^
 /usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:1: error: unknown type name 
 'namespace'
  namespace gcc {
  ^
 /usr/local/gcc/gcc-20130807/gcc/coretypes.h:174:15: error: expected '=', ',', 
 ';', 'asm' or '__attribute__' before '{' token
  namespace gcc {
^
 make[3]: *** [targext.o] Error 1

Sorry.  How does the attached look?  (am bootstrapping now)

commit 7af885276832d17e56cbb8e09787b2d4d95dc5ea
Author: David Malcolm dmalc...@redhat.com
Date:   Wed Aug 7 15:54:26 2013 -0400

Fix C++ usage in coretypes.h

gcc/
	* coretypes.h: Wrap decls using C++ syntax in a #ifdef __cplusplus
	for the sake of source files still built as pure C.

diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index 54bfe7f..b28040a 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -169,11 +169,13 @@ typedef const struct basic_block_def *const_basic_block;
in target.h.  */
 typedef int reg_class_t;
 
+#ifdef __cplusplus
 class rtl_opt_pass;
 
 namespace gcc {
   class context;
 }
+#endif /* __cplusplus */
 
 #else
 


[buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Jan-Benedict Glaw
On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org dmalc...@gcc.gnu.org 
wrote:
 New Revision: 201508
 
 URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
 Log:
 Automated conversion of passes to C++ classes
 
 gcc/
 
   Patch autogenerated by refactor_passes.py from
   https://github.com/davidmalcolm/gcc-refactoring-scripts
   revision 03fe39476a4c4ea450b49e087cfa817b5f92021e

I see quite some fall-out from this on epiphany-elf:

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 
-DGENERATOR_FILE -I. -Ibuild -I../../../../gcc/gcc -I../../../../gcc/gcc/build 
-I../../../../gcc/gcc/../include -I../../../../gcc/gcc/../libcpp/include  
-I../../../../gcc/gcc/../libdecnumber -I../../../../gcc/gcc/../libdecnumber/dpd 
-I../libdecnumber -I../../../../gcc/gcc/../libbacktrace\
-o build/genflags.o ../../../../gcc/gcc/genflags.c
In file included from ./tm.h:21:0,
 from ../../../../gcc/gcc/genflags.c:26:
../../../../gcc/gcc/config/epiphany/epiphany.h:932:8: error: ‘rtl_opt_pass’ 
does not name a type
 extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
^
../../../../gcc/gcc/config/epiphany/epiphany.h:933:8: error: ‘rtl_opt_pass’ 
does not name a type
 extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
^

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
  Signature of:  Zensur im Internet? Nein danke!
  the second  :


signature.asc
Description: Digital signature


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Jan-Benedict Glaw
On Tue, 2013-08-06 13:12:57 +0200, Jan-Benedict Glaw jbg...@lug-owl.de wrote:
 On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
 dmalc...@gcc.gnu.org wrote:
  New Revision: 201508
  
  URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
  Log:
  Automated conversion of passes to C++ classes
  
  gcc/
  
  Patch autogenerated by refactor_passes.py from
  https://github.com/davidmalcolm/gcc-refactoring-scripts
  revision 03fe39476a4c4ea450b49e087cfa817b5f92021e

And probably also for rl78-elf:

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/rl78/rl78.c -o rl78.o
../../../../gcc/gcc/config/rl78/rl78.c:146:1: error: in C++98 
‘rl78_devirt_pass’ must be initialized by constructor, not by ‘{...}’
 };
 ^
../../../../gcc/gcc/config/rl78/rl78.c:146:1: error: could not convert 
‘{RTL_PASS, devirt, 0, devirt_gate, devirt_pass, 0, 0, 212, TV_MACH_DEP, 0, 
0, 0, 0, 0}’ from ‘brace-enclosed initializer list’ to ‘opt_pass’

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
  Signature of:  Zensur im Internet? Nein danke!
  the second  :


signature.asc
Description: Digital signature


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Jan-Benedict Glaw
On Tue, 2013-08-06 13:18:16 +0200, Jan-Benedict Glaw jbg...@lug-owl.de wrote:
 On Tue, 2013-08-06 13:12:57 +0200, Jan-Benedict Glaw jbg...@lug-owl.de 
 wrote:
  On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
  dmalc...@gcc.gnu.org wrote:
   New Revision: 201508
   
   URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
   Log:
   Automated conversion of passes to C++ classes
   
   gcc/
   
 Patch autogenerated by refactor_passes.py from
 https://github.com/davidmalcolm/gcc-refactoring-scripts
 revision 03fe39476a4c4ea450b49e087cfa817b5f92021e

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 */
   ^

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
 Signature of:Arroganz verkürzt fruchtlose Gespräche.
 the second  :   -- Jan-Benedict Glaw


signature.asc
Description: Digital signature


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Jan-Benedict Glaw
On Tue, 2013-08-06 14:10:11 +0200, Jan-Benedict Glaw jbg...@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.

MfG, JBG

-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
Signature of: 23:53 @jbglaw So, ich kletter' jetzt mal ins Bett.
the second  : 23:57 @jever2 .oO( kletter ..., hat er noch Gitter vorm Bett, 
wie früher meine Kinder?)
  00:00 @jbglaw jever2: *patsch*
  00:01 @jever2 *aua*, wofür, Gedanken sind frei!
  00:02 @jbglaw Nee, freie Gedanken, die sind seit 1984 doch aus!
  00:03 @jever2 1984? ich bin erst seit 1985 verheiratet!


signature.asc
Description: Digital signature


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 13:12 +0200, Jan-Benedict Glaw wrote:
 On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
 dmalc...@gcc.gnu.org wrote:
  New Revision: 201508
  
  URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
  Log:
  Automated conversion of passes to C++ classes
  
  gcc/
  
  Patch autogenerated by refactor_passes.py from
  https://github.com/davidmalcolm/gcc-refactoring-scripts
  revision 03fe39476a4c4ea450b49e087cfa817b5f92021e
 
 I see quite some fall-out from this on epiphany-elf:
 
 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 -DGENERATOR_FILE -I. -Ibuild -I../../../../gcc/gcc 
 -I../../../../gcc/gcc/build -I../../../../gcc/gcc/../include 
 -I../../../../gcc/gcc/../libcpp/include  
 -I../../../../gcc/gcc/../libdecnumber 
 -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
 -I../../../../gcc/gcc/../libbacktrace\
 -o build/genflags.o ../../../../gcc/gcc/genflags.c
 In file included from ./tm.h:21:0,
  from ../../../../gcc/gcc/genflags.c:26:
 ../../../../gcc/gcc/config/epiphany/epiphany.h:932:8: error: ‘rtl_opt_pass’ 
 does not name a type
  extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
 ^
 ../../../../gcc/gcc/config/epiphany/epiphany.h:933:8: error: ‘rtl_opt_pass’ 
 does not name a type
  extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
 ^
Sorry about this, clearly I failed to test the target-specific passes.

epiphany_init does some interesting manipulation of passes.  I don't
have epiphany hardware, but I've reproduced the build failure on my
x86_64 box using --configure target=epiphany-elf, and the attached patch
ports it to the new API.  With this patch, stage 1 was able to build,
and cc1 seems to generate assembler on a trivial test. I was able to
step through epiphany_init's pass manipulation, and it appears to be
doing the right thing.

This does add two new headers to epiphany.c; I'm not seeing where to add
the deps (gcc/config/epiphany/t-epiphany doesn't list epiphany.o).

I'm kicking off a bootstrap of this (on x86_64) to further verify that
the non-epiphany changes are good.  What other testing can I do to
verify this?

gcc/

* config/epiphany/epiphany.c (pass_mode_switch_use): New.
(epiphany_init): Port to new C++ pass API.
(epiphany_optimize_mode_switching): Likewise.
* config/epiphany/epiphany.h: Likewise.
* pass_manager.h (pass_manager::get_pass_split_all_insns): New.
(pass_manager::get_pass_mode_switching): New.
(pass_manager::get_pass_peephole2): New.
* mode-switching.c (pass_mode_switching): Add clone method.
* recog.c (pass_peephole2): Add clone method.
(pass_split_all_insns): Add clone method.

Sorry again about this.
Index: gcc/mode-switching.c
===
--- gcc/mode-switching.c	(revision 201526)
+++ gcc/mode-switching.c	(working copy)
@@ -809,6 +809,9 @@
   {}
 
   /* opt_pass methods: */
+  /* The epiphany backend creates a second instance of this pass, so we need
+ a clone method.  */
+  opt_pass * clone () { return new pass_mode_switching (ctxt_); }
   bool gate () { return gate_mode_switching (); }
   unsigned int execute () { return rest_of_handle_mode_switching (); }
 
Index: gcc/config/epiphany/epiphany.c
===
--- gcc/config/epiphany/epiphany.c	(revision 201526)
+++ gcc/config/epiphany/epiphany.c	(working copy)
@@ -45,6 +45,8 @@
 #include ggc.h
 #include tm-constrs.h
 #include tree-pass.h	/* for current_pass */
+#include context.h
+#include pass_manager.h
 
 /* Which cpu we're compiling for.  */
 int epiphany_cpu_type;
@@ -59,6 +61,9 @@
 /* The rounding mode that we generally use for floating point.  */
 int epiphany_normal_fp_rounding;
 
+/* The pass instance, for use in epiphany_optimize_mode_switching. */
+static opt_pass *pass_mode_switch_use;
+
 static void epiphany_init_reg_tables (void);
 static int get_epiphany_condition_code (rtx);
 static tree epiphany_handle_interrupt_attribute (tree *, tree, tree, int, bool *);
@@ -165,20 +170,24 @@
  pass because of the side offect of epiphany_mode_needed on
  MACHINE_FUNCTION(cfun)-unknown_mode_uses.  But it must run before
  pass_resolve_sw_modes.  */
-  static struct register_pass_info insert_use_info
-= { pass_mode_switch_use.pass, mode_sw,
+  pass_mode_switch_use = make_pass_mode_switch_use (g);
+  struct register_pass_info insert_use_info
+= { pass_mode_switch_use, mode_sw,
 	1, PASS_POS_INSERT_AFTER
   };
-  static struct register_pass_info mode_sw2_info
-= { pass_mode_switching.pass, mode_sw,
+  opt_pass 

Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 12:06 -0400, David Malcolm wrote:
 On Tue, 2013-08-06 at 13:12 +0200, Jan-Benedict Glaw wrote:
  On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
  dmalc...@gcc.gnu.org wrote:
   New Revision: 201508
   
   URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
   Log:
   Automated conversion of passes to C++ classes
   
   gcc/
   
 Patch autogenerated by refactor_passes.py from
 https://github.com/davidmalcolm/gcc-refactoring-scripts
 revision 03fe39476a4c4ea450b49e087cfa817b5f92021e
  
  I see quite some fall-out from this on epiphany-elf:
  
  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 -DGENERATOR_FILE -I. -Ibuild -I../../../../gcc/gcc 
  -I../../../../gcc/gcc/build -I../../../../gcc/gcc/../include 
  -I../../../../gcc/gcc/../libcpp/include  
  -I../../../../gcc/gcc/../libdecnumber 
  -I../../../../gcc/gcc/../libdecnumber/dpd -I../libdecnumber 
  -I../../../../gcc/gcc/../libbacktrace\
  -o build/genflags.o ../../../../gcc/gcc/genflags.c
  In file included from ./tm.h:21:0,
   from ../../../../gcc/gcc/genflags.c:26:
  ../../../../gcc/gcc/config/epiphany/epiphany.h:932:8: error: ‘rtl_opt_pass’ 
  does not name a type
   extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
  ^
  ../../../../gcc/gcc/config/epiphany/epiphany.h:933:8: error: ‘rtl_opt_pass’ 
  does not name a type
   extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
  ^
 Sorry about this, clearly I failed to test the target-specific passes.
 
 epiphany_init does some interesting manipulation of passes.  I don't
 have epiphany hardware, but I've reproduced the build failure on my
 x86_64 box using --configure target=epiphany-elf, and the attached patch
 ports it to the new API.  With this patch, stage 1 was able to build,
 and cc1 seems to generate assembler on a trivial test. I was able to
 step through epiphany_init's pass manipulation, and it appears to be
 doing the right thing.
 
 This does add two new headers to epiphany.c; I'm not seeing where to add
 the deps (gcc/config/epiphany/t-epiphany doesn't list epiphany.o).
 
 I'm kicking off a bootstrap of this (on x86_64) to further verify that
 the non-epiphany changes are good.  What other testing can I do to
 verify this?
 
 gcc/
 
   * config/epiphany/epiphany.c (pass_mode_switch_use): New.
   (epiphany_init): Port to new C++ pass API.
   (epiphany_optimize_mode_switching): Likewise.
   * config/epiphany/epiphany.h: Likewise.
   * pass_manager.h (pass_manager::get_pass_split_all_insns): New.
   (pass_manager::get_pass_mode_switching): New.
   (pass_manager::get_pass_peephole2): New.
   * mode-switching.c (pass_mode_switching): Add clone method.
   * recog.c (pass_peephole2): Add clone method.
   (pass_split_all_insns): Add clone method.
 
This patch also removed static qualifiers from the register_pass_info,
which may have been overzealous, though they seemed pointless: the
struct is only used during the lifetime of the register_pass call.



Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Jan-Benedict Glaw
On Tue, 2013-08-06 12:06:24 -0400, David Malcolm dmalc...@redhat.com wrote:
 On Tue, 2013-08-06 at 13:12 +0200, Jan-Benedict Glaw wrote:
  On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
  dmalc...@gcc.gnu.org wrote:
[Breakage on epiphany-elf]

 I'm kicking off a bootstrap of this (on x86_64) to further verify that
 the non-epiphany changes are good.  What other testing can I do to
 verify this?

Dunno.  I didn't do more than that with my build robot. Specifically,
I don't have the hardware, so I cannot recommend any further tests.
Maybe the port maintainer (added) could run a gcc built with your
patch[1] to verify it's still working?

MfG, JBG

[1] http://gcc.gnu.org/ml/gcc-patches/2013-08/msg00286.html
-- 
  Jan-Benedict Glaw  jbg...@lug-owl.de  +49-172-7608481
Signature of:http://www.chiark.greenend.org.uk/~sgtatham/bugs.html
the second  :


signature.asc
Description: Digital signature


[rl78]: Port to new pass C++ API (was Re: [buildbot] r201508: Build failures after pass C++ conversion)

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 13:18 +0200, Jan-Benedict Glaw wrote:
 On Tue, 2013-08-06 13:12:57 +0200, Jan-Benedict Glaw jbg...@lug-owl.de 
 wrote:
  On Mon, 2013-08-05 20:16:05 -, dmalc...@gcc.gnu.org 
  dmalc...@gcc.gnu.org wrote:
   New Revision: 201508
   
   URL: http://gcc.gnu.org/viewcvs?rev=201508root=gccview=rev
   Log:
   Automated conversion of passes to C++ classes
   
   gcc/
   
 Patch autogenerated by refactor_passes.py from
 https://github.com/davidmalcolm/gcc-refactoring-scripts
 revision 03fe39476a4c4ea450b49e087cfa817b5f92021e
 
 And probably also for rl78-elf:
 
 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/rl78/rl78.c -o rl78.o
 ../../../../gcc/gcc/config/rl78/rl78.c:146:1: error: in C++98 
 ‘rl78_devirt_pass’ must be initialized by constructor, not by ‘{...}’
  };
  ^
 ../../../../gcc/gcc/config/rl78/rl78.c:146:1: error: could not convert 
 ‘{RTL_PASS, devirt, 0, devirt_gate, devirt_pass, 0, 0, 212, TV_MACH_DEP, 0, 
 0, 0, 0, 0}’ from ‘brace-enclosed initializer list’ to ‘opt_pass’
 
 MfG, JBG

Sorry again.

The attached patch fixes the build for me with --target=rl78-elf.  Only
tested lightly with buildhost=x86_64 so far; I was able to build
stage1, verify cc1 generates assembler on a simple .c file, and step
through the changed code.   However it's much more self-contained than
the epiphany fix.  There was a hardcoded value of 212 for the
static_pass_number of the pass, which may have been what stopped by
automated script from fixing this, so I set this in the ctor in case
anything is relying on this.  The make_pass_rl78_devirt function is
rather redundant, but I was deliberately mimicking the changes made by
the automated script.

It adds a dep on context.h to gcc/config/rl78/rl78.c, and I didn't see
how to add this (t-rl78 only lists rl78-c.o).

commit 4eb61ff39f72295f680d4be9d447e7e6bdfe629f
Author: David Malcolm dmalc...@redhat.com
Date:   Tue Aug 6 13:08:42 2013 -0400

gcc/
	* config/rl78/rl78.c (rl78_devirt_pass): Convert from a struct to...
	(pass_rl78_devirt): ...new subclass of rtl_opt_pass along with...
	(pass_data_rl78_devirt): ...new pass_data instance and...
	(make_pass_rl78_devirt): ...new function.
	(rl78_asm_file_start): Port pass registration to new C++ API.

diff --git a/gcc/config/rl78/rl78.c b/gcc/config/rl78/rl78.c
index c2ed738..5bfb21f 100644
--- a/gcc/config/rl78/rl78.c
+++ b/gcc/config/rl78/rl78.c
@@ -49,6 +49,7 @@
 #include rl78-protos.h
 #include dumpfile.h
 #include tree-pass.h
+#include context.h
 
 static inline bool is_interrupt_func (const_tree decl);
 static inline bool is_brk_interrupt_func (const_tree decl);
@@ -129,30 +130,48 @@ devirt_pass (void)
 /* This pass converts virtual instructions using virtual registers, to
real instructions using real registers.  Rather than run it as
reorg, we reschedule it before vartrack to help with debugging.  */
-static struct opt_pass rl78_devirt_pass =
-{
-  RTL_PASS,
-  devirt,
-  OPTGROUP_NONE,/* optinfo_flags */
-  devirt_gate,
-  devirt_pass,
-  NULL,
-  NULL,
-  212,
-  TV_MACH_DEP,
-  0, 0, 0,
-  0,
-  0
+namespace {
+
+const pass_data pass_data_rl78_devirt =
+{
+  RTL_PASS, /* type */
+  devirt, /* name */
+  OPTGROUP_NONE, /* optinfo_flags */
+  true, /* has_gate */
+  true, /* has_execute */
+  TV_MACH_DEP, /* tv_id */
+  0, /* properties_required */
+  0, /* properties_provided */
+  0, /* properties_destroyed */
+  0, /* todo_flags_start */
+  0, /* todo_flags_finish */
 };
 
-static struct register_pass_info rl78_devirt_info =
+class pass_rl78_devirt : public rtl_opt_pass
 {
-   rl78_devirt_pass,
-  vartrack,
-  1,
-  PASS_POS_INSERT_BEFORE
+public:
+  pass_rl78_devirt(gcc::context *ctxt)
+: rtl_opt_pass(pass_data_rl78_devirt, ctxt)
+  {
+/* Prior to porting to C++, the static_pass_number was hardcoded
+   to 212.  Replicate this behavior. */
+static_pass_number = 212;
+  }
+
+  /* opt_pass methods: */
+  bool gate () { return devirt_gate (); }
+  unsigned int execute () { return devirt_pass (); }
 };
 
+} // anon namespace
+
+rtl_opt_pass *
+make_pass_rl78_devirt (gcc::context *ctxt)
+{
+  return new pass_rl78_devirt (ctxt);
+}
+
+
 #undef  TARGET_ASM_FILE_START
 #define TARGET_ASM_FILE_START rl78_asm_file_start
 
@@ -167,6 +186,15 @@ rl78_asm_file_start (void)
   fprintf (asm_out_file, r%d\t=\t0x%x\n, 16 + i, 0xffee8 + i);
 }
 
+  opt_pass 

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

2013-08-06 Thread David Malcolm
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 jbg...@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 buildhost 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
commit 8abbe9fbce66bdb1b03281fc06bc86707b5b3cf6
Author: David Malcolm dmalc...@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 \


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Richard Henderson
On 08/06/2013 06:06 AM, David Malcolm wrote:
 Index: gcc/config/epiphany/epiphany.h
 ===
 --- gcc/config/epiphany/epiphany.h(revision 201526)
 +++ gcc/config/epiphany/epiphany.h(working copy)
 @@ -929,6 +929,9 @@
  };
  
  extern int epiphany_normal_fp_rounding;
 +
 +class rtl_opt_pass;
 +namespace gcc { class context; }
  extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
  extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);

Looks like these definitions ought to go into coretypes.h.


r~


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 10:34 -1000, Richard Henderson wrote:
 On 08/06/2013 06:06 AM, David Malcolm wrote:
  Index: gcc/config/epiphany/epiphany.h
  ===
  --- gcc/config/epiphany/epiphany.h  (revision 201526)
  +++ gcc/config/epiphany/epiphany.h  (working copy)
  @@ -929,6 +929,9 @@
   };
   
   extern int epiphany_normal_fp_rounding;
  +
  +class rtl_opt_pass;
  +namespace gcc { class context; }
   extern rtl_opt_pass *make_pass_mode_switch_use (gcc::context *ctxt);
   extern rtl_opt_pass *make_pass_resolve_sw_modes (gcc::context *ctxt);
 
 Looks like these definitions ought to go into coretypes.h.

Something like the attached, putting them in the
   #ifndef USED_FOR_TARGET
part?   (this passes the same light testing as on the first patch;
bootstrap of the first patch succeeded on x86_64; am now bootstrapping
the attached patch on x86_64).

commit f5d8960c711540d28be2fd923d65838cb88b34f5
Author: David Malcolm dmalc...@redhat.com
Date:   Tue Aug 6 12:41:31 2013 -0400

gcc/
	* coretypes.h (rtl_opt_pass): Add.
	(gcc::context): Add.
	* config/epiphany/epiphany.c (pass_mode_switch_use): New.
	(epiphany_init): Port to new C++ pass API.
	(epiphany_optimize_mode_switching): Likewise.
	* pass_manager.h (pass_manager::get_pass_split_all_insns): New.
	(pass_manager::get_pass_mode_switching): New.
	(pass_manager::get_pass_peephole2): New.
	* mode-switching.c (pass_mode_switching): Add clone method.
	* recog.c (pass_peephole2): Add clone method.
	(pass_split_all_insns): Add clone method.

diff --git a/gcc/config/epiphany/epiphany.c b/gcc/config/epiphany/epiphany.c
index 1dcdc4b..5d020bb 100644
--- a/gcc/config/epiphany/epiphany.c
+++ b/gcc/config/epiphany/epiphany.c
@@ -45,6 +45,8 @@ along with GCC; see the file COPYING3.  If not see
 #include ggc.h
 #include tm-constrs.h
 #include tree-pass.h	/* for current_pass */
+#include context.h
+#include pass_manager.h
 
 /* Which cpu we're compiling for.  */
 int epiphany_cpu_type;
@@ -59,6 +61,9 @@ char epiphany_punct_chars[256];
 /* The rounding mode that we generally use for floating point.  */
 int epiphany_normal_fp_rounding;
 
+/* The pass instance, for use in epiphany_optimize_mode_switching. */
+static opt_pass *pass_mode_switch_use;
+
 static void epiphany_init_reg_tables (void);
 static int get_epiphany_condition_code (rtx);
 static tree epiphany_handle_interrupt_attribute (tree *, tree, tree, int, bool *);
@@ -165,20 +170,24 @@ epiphany_init (void)
  pass because of the side offect of epiphany_mode_needed on
  MACHINE_FUNCTION(cfun)-unknown_mode_uses.  But it must run before
  pass_resolve_sw_modes.  */
-  static struct register_pass_info insert_use_info
-= { pass_mode_switch_use.pass, mode_sw,
+  pass_mode_switch_use = make_pass_mode_switch_use (g);
+  struct register_pass_info insert_use_info
+= { pass_mode_switch_use, mode_sw,
 	1, PASS_POS_INSERT_AFTER
   };
-  static struct register_pass_info mode_sw2_info
-= { pass_mode_switching.pass, mode_sw,
+  opt_pass *mode_sw2 = g-get_passes()-get_pass_mode_switching()-clone ();
+  struct register_pass_info mode_sw2_info
+= { mode_sw2, mode_sw,
 	1, PASS_POS_INSERT_AFTER
   };
-  static struct register_pass_info mode_sw3_info
-= { pass_resolve_sw_modes.pass, mode_sw,
+  opt_pass *mode_sw3 = make_pass_resolve_sw_modes (g);
+  struct register_pass_info mode_sw3_info
+= { mode_sw3, mode_sw,
 	1, PASS_POS_INSERT_AFTER
   };
-  static struct register_pass_info mode_sw4_info
-= { pass_split_all_insns.pass, mode_sw,
+  opt_pass *mode_sw4 = g-get_passes()-get_pass_split_all_insns()-clone ();
+  struct register_pass_info mode_sw4_info
+= { mode_sw4, mode_sw,
 	1, PASS_POS_INSERT_AFTER
   };
   static const int num_modes[] = NUM_MODES_FOR_MODE_SWITCHING;
@@ -205,8 +214,10 @@ epiphany_init (void)
  (see http://gcc.gnu.org/ml/gcc-patches/2011-10/msg02819.html,)
  we need a second peephole2 pass to get reasonable code.  */
   {
-static struct register_pass_info peep2_2_info
-  = { pass_peephole2.pass, peephole2,
+opt_pass *extra_peephole2
+  = g-get_passes ()-get_pass_peephole2()-clone ();
+struct register_pass_info peep2_2_info
+  = { extra_peephole2, peephole2,
 	  1, PASS_POS_INSERT_AFTER
 	};
 
@@ -2256,7 +2267,7 @@ epiphany_optimize_mode_switching (int entity)
   return (MACHINE_FUNCTION (cfun)-sw_entities_processed
 	   (1  EPIPHANY_MSW_ENTITY_ROUND_UNKNOWN)) != 0;
 case EPIPHANY_MSW_ENTITY_FPU_OMNIBUS:
-  return optimize == 0 || current_pass == pass_mode_switch_use.pass;
+  return optimize == 0 || current_pass == pass_mode_switch_use;
 }
   gcc_unreachable ();
 }
diff --git a/gcc/coretypes.h b/gcc/coretypes.h
index edb9c8c..54bfe7f 100644
--- a/gcc/coretypes.h
+++ b/gcc/coretypes.h
@@ -169,6 +169,12 @@ typedef const struct basic_block_def *const_basic_block;
in target.h.  */
 typedef int 

Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread Richard Henderson
On 08/06/2013 11:23 AM, David Malcolm wrote:
 gcc/
   * coretypes.h (rtl_opt_pass): Add.
   (gcc::context): Add.
   * config/epiphany/epiphany.c (pass_mode_switch_use): New.
   (epiphany_init): Port to new C++ pass API.
   (epiphany_optimize_mode_switching): Likewise.
   * pass_manager.h (pass_manager::get_pass_split_all_insns): New.
   (pass_manager::get_pass_mode_switching): New.
   (pass_manager::get_pass_peephole2): New.
   * mode-switching.c (pass_mode_switching): Add clone method.
   * recog.c (pass_peephole2): Add clone method.
   (pass_split_all_insns): Add clone method.

Ok.


r~


Re: [rl78]: Port to new pass C++ API (was Re: [buildbot] r201508: Build failures after pass C++ conversion)

2013-08-06 Thread DJ Delorie

Go for it.  The static 212 is not required as long as the pass shows
up in the right spot in the pass sequence.


Re: [buildbot] r201508: Build failures after pass C++ conversion

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 12:49 -1000, Richard Henderson wrote:
 On 08/06/2013 11:23 AM, David Malcolm wrote:
  gcc/
  * coretypes.h (rtl_opt_pass): Add.
  (gcc::context): Add.
  * config/epiphany/epiphany.c (pass_mode_switch_use): New.
  (epiphany_init): Port to new C++ pass API.
  (epiphany_optimize_mode_switching): Likewise.
  * pass_manager.h (pass_manager::get_pass_split_all_insns): New.
  (pass_manager::get_pass_mode_switching): New.
  (pass_manager::get_pass_peephole2): New.
  * mode-switching.c (pass_mode_switching): Add clone method.
  * recog.c (pass_peephole2): Add clone method.
  (pass_split_all_insns): Add clone method.
 
 Ok.
Thanks.

Committed to trunk as r201549 (I saw some missing spaces between parens
after a successful boostrap/test on x86_64, which I fixed, and then
verified a clean build with --target=epiphany-elf before committing).



Re: [rl78]: Port to new pass C++ API (was Re: [buildbot] r201508: Build failures after pass C++ conversion)

2013-08-06 Thread David Malcolm
On Tue, 2013-08-06 at 19:53 -0400, DJ Delorie wrote:
 Go for it.  The static 212 is not required as long as the pass shows
 up in the right spot in the pass sequence.
Thanks.  I checked, and both with and without the hardcoded 212, the
dumpfile for the pass for a foo.c is currently:
  foo.c.246r.devirt
i.e. 246, not 212.

I've committed it to trunk (without the 212) as r201553 (having checked
the build of stage1 and a smoketest).