Patchwork make -fstrict-volatile-bitfields the default for m32c, rx, sh, h8

login
register
mail settings
Submitter DJ Delorie
Date July 9, 2010, 10:46 p.m.
Message ID <201007092246.o69MkQPf029572@greed.delorie.com>
Download mbox | patch
Permalink /patch/58439/
State New
Headers show

Comments

DJ Delorie - July 9, 2010, 10:46 p.m.
This change has been requested by Renesas for their chips, some of
which require this functionality and the rest for consistency.  Ok to
apply?  (obviously, I'm asking for the sh, h8, and rx targets - I'm
the m32c maintainer :)


	* config/h8300/h8300.c (h8300_init_once): Default to
	-fstrict_volatile_bitfields.

	* config/sh/sh.c (sh_override_options): Default to
	-fstrict_volatile_bitfields.

	* config/rx/rx.h (OVERRIDE_OPTIONS): Define.
	* config/rx/rx-protos.h (rx_override_options): Declare.
	* config/rx/rx.c (rx_override_options): New.

	* config/m32c/m32c.c (m32c_override_options): Default to
	-fstrict_volatile_bitfields.
Nathan Froyd - July 9, 2010, 11:26 p.m.
On Fri, Jul 09, 2010 at 06:46:26PM -0400, DJ Delorie wrote:
> Index: config/rx/rx.h
> ===================================================================
> --- config/rx/rx.h	(revision 162014)
> +++ config/rx/rx.h	(working copy)
> @@ -87,12 +87,14 @@ extern enum rx_cpu_types  rx_cpu_type;
>  --end-group					   	\
>  %{!T*: %{msim*:%Trx-sim.ld}%{!msim*:%Trx.ld}}		\
>  "
>  
>  #undef  LINK_SPEC
>  #define LINK_SPEC "%{mbig-endian-data:--oformat elf32-rx-be} %{mrelax:-relax}"
> +
> +#define OVERRIDE_OPTIONS rx_override_options ()

Could you please use TARGET_OVERRIDE_OPTIONS here?

-Nathan
Kaz Kojima - July 13, 2010, 10:46 a.m.
DJ Delorie <dj@redhat.com> wrote:
> This change has been requested by Renesas for their chips, some of
> which require this functionality and the rest for consistency.  Ok to
> apply?  (obviously, I'm asking for the sh, h8, and rx targets - I'm
> the m32c maintainer :)
[snip]
> 	* config/sh/sh.c (sh_override_options): Default to
> 	-fstrict_volatile_bitfields.

SH part is OK.  Sorry for the delay.

Regards,
	kaz
Jeff Law - July 13, 2010, 2:58 p.m.
On 07/13/10 04:46, Kaz Kojima wrote:
> DJ Delorie<dj@redhat.com>  wrote:
>    
>> This change has been requested by Renesas for their chips, some of
>> which require this functionality and the rest for consistency.  Ok to
>> apply?  (obviously, I'm asking for the sh, h8, and rx targets - I'm
>> the m32c maintainer :)
>>      
> [snip]
>    
>> 	* config/sh/sh.c (sh_override_options): Default to
>> 	-fstrict_volatile_bitfields.
>>      
> SH part is OK.  Sorry for the delay.
>    
H8 is OK too.
jeff
DJ Delorie - July 13, 2010, 7:43 p.m.
> SH part is OK.  Sorry for the delay.

> H8 is OK too.

> Approved for RX.

Thanks!  Committed as 162149.

Patch

Index: config/m32c/m32c.c
===================================================================
--- config/m32c/m32c.c	(revision 162014)
+++ config/m32c/m32c.c	(working copy)
@@ -428,12 +428,16 @@  m32c_override_options (void)
     }
   else
     target_memregs = 16;
 
   if (TARGET_A24)
     flag_ivopts = 0;
+
+  /* This target defaults to strict volatile bitfields.  */
+  if (flag_strict_volatile_bitfields < 0)
+    flag_strict_volatile_bitfields = 1;
 }
 
 /* Defining data structures for per-function information */
 
 /* The usual; we set up our machine_function data.  */
 static struct machine_function *
Index: config/rx/rx.h
===================================================================
--- config/rx/rx.h	(revision 162014)
+++ config/rx/rx.h	(working copy)
@@ -87,12 +87,14 @@  extern enum rx_cpu_types  rx_cpu_type;
 --end-group					   	\
 %{!T*: %{msim*:%Trx-sim.ld}%{!msim*:%Trx.ld}}		\
 "
 
 #undef  LINK_SPEC
 #define LINK_SPEC "%{mbig-endian-data:--oformat elf32-rx-be} %{mrelax:-relax}"
+
+#define OVERRIDE_OPTIONS rx_override_options ()
 
 
 #define BITS_BIG_ENDIAN 		0
 #define BYTES_BIG_ENDIAN 		TARGET_BIG_ENDIAN_DATA
 #define WORDS_BIG_ENDIAN 		TARGET_BIG_ENDIAN_DATA
 
Index: config/rx/rx-protos.h
===================================================================
--- config/rx/rx-protos.h	(revision 162014)
+++ config/rx/rx-protos.h	(working copy)
@@ -26,12 +26,13 @@ 
 #define Fargs	CUMULATIVE_ARGS
 
 extern void		rx_conditional_register_usage (void);
 extern void		rx_expand_prologue (void);
 extern int		rx_initial_elimination_offset (int, int);
 extern void		rx_set_optimization_options (void);
+extern void		rx_override_options (void);
 
 #ifdef RTX_CODE
 extern bool		rx_compare_redundant (rtx);
 extern void             rx_emit_stack_popm (rtx *, bool);
 extern void             rx_emit_stack_pushm (rtx *);
 extern void		rx_expand_epilogue (bool);
Index: config/rx/rx.c
===================================================================
--- config/rx/rx.c	(revision 162014)
+++ config/rx/rx.c	(working copy)
@@ -2187,12 +2187,21 @@  rx_set_optimization_options (void)
 
       if (saved_allow_rx_fpu != ALLOW_RX_FPU_INSNS)
 	error ("Changing the FPU insns/math optimizations pairing is not supported");
     }
 }
 
+/* Implements OVERRIDE_OPTIONS.  */
+void
+rx_override_options (void)
+{
+  /* This target defaults to strict volatile bitfields.  */
+  if (flag_strict_volatile_bitfields < 0)
+    flag_strict_volatile_bitfields = 1;
+}
+
 
 static bool
 rx_allocate_stack_slots_for_args (void)
 {
   /* Naked functions should not allocate stack slots for arguments.  */
   return ! is_naked_func (NULL_TREE);
Index: config/sh/sh.c
===================================================================
--- config/sh/sh.c	(revision 162014)
+++ config/sh/sh.c	(working copy)
@@ -970,12 +970,16 @@  sh_override_options (void)
       if (align_functions < min_align)
 	align_functions = min_align;
     }
 
   if (sh_fixed_range_str)
     sh_fix_range (sh_fixed_range_str);
+
+  /* This target defaults to strict volatile bitfields.  */
+  if (flag_strict_volatile_bitfields < 0)
+    flag_strict_volatile_bitfields = 1;
 }
 
 /* Print the operand address in x to the stream.  */
 
 static void
 sh_print_operand_address (FILE *stream, rtx x)
Index: config/h8300/h8300.c
===================================================================
--- config/h8300/h8300.c	(revision 162014)
+++ config/h8300/h8300.c	(working copy)
@@ -400,12 +400,16 @@  h8300_init_once (void)
     {
       /* We use movmd sequences for some moves since it can be quicker
 	 than calling memcpy().  The sequences will need to save and
 	 restore er6 though, so bump up the cost.  */
       h8300_move_ratio = 6;
     }
+
+  /* This target defaults to strict volatile bitfields.  */
+  if (flag_strict_volatile_bitfields < 0)
+    flag_strict_volatile_bitfields = 1;
 }
 
 /* Implement REG_CLASS_FROM_LETTER.
 
    Some patterns need to use er6 as a scratch register.  This is
    difficult to arrange since er6 is the frame pointer and usually