Patchwork rs6000 options change for rtems.h

login
register
mail settings
Submitter Joel Sherrill
Date Dec. 2, 2011, 4:22 p.m.
Message ID <4ED8FB5F.7070909@oarcorp.com>
Download mbox | patch
Permalink /patch/128901/
State New
Headers show

Comments

Joel Sherrill - Dec. 2, 2011, 4:22 p.m.
Hi,

I have been testing with this for almost a month.  It is
my attempt to follow the changes I think Joseph made
to other rs6000 targets. If this change looks right,
I would like to commit it.

Test results have been posted for it.

Thanks.

2011-12-02  Joel Sherrill <joel.sherrill@oarcorp.com>

     * config/rs6000/rtems.h: Switch to using global_options_set
     in SUBSUBTARGET_OVERRIDE_OPTIONS.
Joseph S. Myers - Dec. 2, 2011, 4:38 p.m.
On Fri, 2 Dec 2011, Joel Sherrill wrote:

> 2011-12-02  Joel Sherrill <joel.sherrill@oarcorp.com>
> 
>     * config/rs6000/rtems.h: Switch to using global_options_set
>     in SUBSUBTARGET_OVERRIDE_OPTIONS.

Is it deliberate that you are removing the first part of each "if" 
condition (thus, no longer checking TARGET_HARD_FLOAT before setting 
rs6000_float_gprs, no longer checking rs6000_float_gprs before setting 
rs6000_spe, etc.)?
Joel Sherrill - Dec. 2, 2011, 4:49 p.m.
On 12/02/2011 10:38 AM, Joseph S. Myers wrote:
> On Fri, 2 Dec 2011, Joel Sherrill wrote:
>
>> 2011-12-02  Joel Sherrill<joel.sherrill@oarcorp.com>
>>
>>      * config/rs6000/rtems.h: Switch to using global_options_set
>>      in SUBSUBTARGET_OVERRIDE_OPTIONS.
> Is it deliberate that you are removing the first part of each "if"
> condition (thus, no longer checking TARGET_HARD_FLOAT before setting
> rs6000_float_gprs, no longer checking rs6000_float_gprs before setting
> rs6000_spe, etc.)?
>
I patterned this after what was in other files.
It is done this way everywhere it is referenced.

Should all of them be changed?

$ grep global_options_set.x_rs6000_float_gprs *
e500-double.h:  if (!global_options_set.x_rs6000_float_gprs) \
eabispe.h:  if (!global_options_set.x_rs6000_float_gprs) \
linuxspe.h:  if (!global_options_set.x_rs6000_float_gprs) \
rs6000.c:         if (!global_options_set.x_rs6000_float_gprs)
rtems.h:        if (!global_options_set.x_rs6000_float_gprs) \
Joseph S. Myers - Dec. 2, 2011, 5:57 p.m.
On Fri, 2 Dec 2011, Joel Sherrill wrote:

> On 12/02/2011 10:38 AM, Joseph S. Myers wrote:
> > On Fri, 2 Dec 2011, Joel Sherrill wrote:
> > 
> > > 2011-12-02  Joel Sherrill<joel.sherrill@oarcorp.com>
> > > 
> > >      * config/rs6000/rtems.h: Switch to using global_options_set
> > >      in SUBSUBTARGET_OVERRIDE_OPTIONS.
> > Is it deliberate that you are removing the first part of each "if"
> > condition (thus, no longer checking TARGET_HARD_FLOAT before setting
> > rs6000_float_gprs, no longer checking rs6000_float_gprs before setting
> > rs6000_spe, etc.)?
> > 
> I patterned this after what was in other files.
> It is done this way everywhere it is referenced.
> 
> Should all of them be changed?

Not necessarily.

I described how I think this sort of logic should work in 
<http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49854>.  I think that means 
something closer to the other headers than to rtems.h - but I don't think 
a semantic change should be mixed with a change that's just supposed to 
get things to build again.

Patch

Index: gcc/config/rs6000/rtems.h
===================================================================
--- gcc/config/rs6000/rtems.h	(revision 181924)
+++ gcc/config/rs6000/rtems.h	(working copy)
@@ -57,15 +57,15 @@ 
   { "cpp_os_rtems",		CPP_OS_RTEMS_SPEC }
 
 #undef SUBSUBTARGET_OVERRIDE_OPTIONS
-#define SUBSUBTARGET_OVERRIDE_OPTIONS					\
-  do {									\
-    if (TARGET_E500)							\
-      {									\
-        if (TARGET_HARD_FLOAT && !rs6000_explicit_options.float_gprs)	\
-          rs6000_float_gprs = 1; 					\
-        if (rs6000_float_gprs != 0 && !rs6000_explicit_options.spe)	\
-          rs6000_spe = 1;						\
-        if (rs6000_spe && !rs6000_explicit_options.spe_abi)		\
-          rs6000_spe_abi = 1;						\
-      }									\
+#define SUBSUBTARGET_OVERRIDE_OPTIONS		     \
+  do {						     \
+   if (TARGET_E500)                                  \
+      {                                              \
+        if (!global_options_set.x_rs6000_float_gprs) \
+          rs6000_float_gprs = 1;                     \
+        if (!global_options_set.x_rs6000_spe)        \
+          rs6000_spe = 1;                            \
+        if (!global_options_set.x_rs6000_spe_abi)    \
+          rs6000_spe_abi = 1;                        \
+      }                                              \
   } while(0)