Patchwork Rs6000 infrastructure cleanup (switches), revised patch #2f

login
register
mail settings
Submitter Dominique Dhumieres
Date Oct. 18, 2012, 7:08 p.m.
Message ID <20121018190834.1806A3BABA@mailhost.lps.ens.fr>
Download mbox | patch
Permalink /patch/192417/
State New
Headers show

Comments

Dominique Dhumieres - Oct. 18, 2012, 7:08 p.m.
> 2012-10-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
> 
> 	* config/rs6000/rs6000.opt (rs6000_isa_flags): New flag word to
> 	replace target_flags that gives us 63 possible switches.
> 	(x_rs6000_isa_flags): Save area for rs6000_isa_flags.
> 	(x_rs6000_isa_flags_explicit): Save area for
> ...

Bootstrap failed on powerpc-apple-darwin9 with

/opt/gcc/darwin_buildw/./prev-gcc/g++ -B/opt/gcc/darwin_buildw/./prev-gcc/ -B/opt/gcc/gcc4.8w/powerpc-apple-darwin9.8.0/bin/ -nostdinc++ -B/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/src/.libs -B/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs -I/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/include/powerpc-apple-darwin9.8.0 -I/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/include -I/opt/gcc/work/libstdc++-v3/libsupc++ -L/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/src/.libs -L/opt/gcc/darwin_buildw/prev-powerpc-apple-darwin9.8.0/libstdc++-v3/libsupc++/.libs -c   -g -O2 -mdynamic-no-pic -gtoggle -DIN_GCC   -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 -Werror -fno-common  -DHAVE_CONFIG_H -I. -I. -I../../work/gcc -I../../work/gcc/. -I../../work/gcc/../include -I./../intl -I../../work/gcc/../libcpp/include -I/opt/mp/include  -I../../work/gcc/../libdecnumber -I../../work/gcc/../libdecnumber/dpd -I../libdecnumber -I../../work/gcc/../libbacktrace -DCLOOG_INT_GMP  -I/opt/mp/include  \
        ../../work/gcc/config/rs6000/rs6000.c -o rs6000.o
../../work/gcc/config/rs6000/rs6000.c:1126:0: error: "MASK_STRICT_ALIGN" redefined [-Werror]
 #define MASK_STRICT_ALIGN 0
 ^
In file included from ./tm.h:15:0,
                 from ../../work/gcc/config/rs6000/rs6000.c:24:
../../work/gcc/config/rs6000/rs6000.h:490:0: note: this is the location of the previous definition
 #define MASK_STRICT_ALIGN  OPTION_MASK_STRICT_ALIGN
 ^
cc1plus: all warnings being treated as errors

The following patch allowed the bootstrap to complete:

 #ifndef TARGET_PROFILE_KERNEL

I don't know if it is the RIGHT FIX, but it worked.

TIA

Dominique
Mike Stump - Oct. 18, 2012, 8:25 p.m.
On Oct 18, 2012, at 12:08 PM, Dominique Dhumieres <dominiq@lps.ens.fr> wrote:
> --- gcc/config/rs6000/rs6000.c	2012-10-18 00:34:51.000000000 +0200
> +++ ../work/gcc/config/rs6000/rs6000.c	2012-10-18 08:55:28.000000000 +0200
> @@ -1123,6 +1123,7 @@ static const struct attribute_spec rs600
> 
> 
> #ifndef OPTION_MASK_STRICT_ALIGN
> #define OPTION_MASK_STRICT_ALIGN 0
> +#undef MASK_STRICT_ALIGN
> #define MASK_STRICT_ALIGN 0
> #endif
> #ifndef TARGET_PROFILE_KERNEL
> 
> I don't know if it is the RIGHT FIX, but it worked.

Given the context, I'd guess #ifndef MASK_STRICT_ALIGN would be the incantation people want.
Michael Meissner - Oct. 18, 2012, 9:35 p.m.
On Thu, Oct 18, 2012 at 09:08:34PM +0200, Dominique Dhumieres wrote:
> > 2012-10-17  Michael Meissner  <meissner@linux.vnet.ibm.com>
> > 
> > 	* config/rs6000/rs6000.opt (rs6000_isa_flags): New flag word to
> > 	replace target_flags that gives us 63 possible switches.
> > 	(x_rs6000_isa_flags): Save area for rs6000_isa_flags.
> > 	(x_rs6000_isa_flags_explicit): Save area for
> > ...
> 
> Bootstrap failed on powerpc-apple-darwin9 with

Just to let you know, I'm iterating on a patch right now.  There were 3 bugs
with my checkin:

1) The libobjc/encoding.c issue that Eric ran into.  The file encoding.c
   includes compiler tm.h files, and then redefines stuff so that it doesn't
   need the target option structure.  I have a bandaid to redefine TARGET_VSX,
   TARGET_ALTIVEC, and TARGET_64BIT, but this file really cries out for an
   Objective C user to reengineer and rewrite it so that it doesn't have to
   include compiler internal files.

2) The redefinition problem that Dominique found.  This was caused by moving
   POWERPC_MASKS from rs6000.c to rs6000-cpus.def, where it more logically
   belongs.  I think the right solution is to move the #ifdef to
   rs6000-cpus.def instead of keeping it in rs6000.c.

3) I forgot to update the -mdebug=reg support so it prints out the current
   options once I swtiched from using target_flags to rs6000_isa_flags.  I
   discovered this today, when doing some future work (that needs new
   options).

I'll send out the patch if my bootstrap finishes.

Patch

--- gcc/config/rs6000/rs6000.c	2012-10-18 00:34:51.000000000 +0200
+++ ../work/gcc/config/rs6000/rs6000.c	2012-10-18 08:55:28.000000000 +0200
@@ -1123,6 +1123,7 @@  static const struct attribute_spec rs600
 

 #ifndef OPTION_MASK_STRICT_ALIGN
 #define OPTION_MASK_STRICT_ALIGN 0
+#undef MASK_STRICT_ALIGN
 #define MASK_STRICT_ALIGN 0
 #endif