sh.c (sh_handle_option): Access target_flags via opts pointer.
authorJoseph Myers <joseph@codesourcery.com>
Tue, 22 Mar 2011 22:46:13 +0000 (22:46 +0000)
committerJoseph Myers <jsm28@gcc.gnu.org>
Tue, 22 Mar 2011 22:46:13 +0000 (22:46 +0000)
* config/sh/sh.c (sh_handle_option): Access target_flags via opts
pointer.  Don't assert that global structures are in use.

From-SVN: r171326

gcc/ChangeLog
gcc/config/sh/sh.c

index 17745df185b78abc6f7678c39e112d9c10932d8c..88c6de6139931badad1b15f8832b9cacd465e9df 100644 (file)
@@ -1,3 +1,8 @@
+2011-03-22  Joseph Myers  <joseph@codesourcery.com>
+
+       * config/sh/sh.c (sh_handle_option): Access target_flags via opts
+       pointer.  Don't assert that global structures are in use.
+
 2011-03-22  Joseph Myers  <joseph@codesourcery.com>
 
        * config/pdp11/pdp11.c (pdp11_handle_option): Access target_flags
index bbeb7a258ddd38b0c0a8275317d8befbb6033c9b..926c2f59ddc45496710f16f9ddee627b6355b696 100644 (file)
@@ -606,58 +606,59 @@ struct gcc_target targetm = TARGET_INITIALIZER;
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-sh_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
+sh_handle_option (struct gcc_options *opts,
+                 struct gcc_options *opts_set ATTRIBUTE_UNUSED,
                  const struct cl_decoded_option *decoded,
                  location_t loc ATTRIBUTE_UNUSED)
 {
   size_t code = decoded->opt_index;
 
-  gcc_assert (opts == &global_options);
-  gcc_assert (opts_set == &global_options_set);
-
   switch (code)
     {
     case OPT_m1:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH1;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH1;
       return true;
 
     case OPT_m2:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2;
       return true;
 
     case OPT_m2a:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A;
       return true;
 
     case OPT_m2a_nofpu:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_NOFPU;
       return true;
 
     case OPT_m2a_single:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE;
       return true;
 
     case OPT_m2a_single_only:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE_ONLY;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2A_SINGLE_ONLY;
       return true;
 
     case OPT_m2e:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH2E;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH2E;
       return true;
 
     case OPT_m3:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH3;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3;
       return true;
 
     case OPT_m3e:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH3E;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH3E;
       return true;
 
     case OPT_m4:
     case OPT_m4_100:
     case OPT_m4_200:
     case OPT_m4_300:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4;
       return true;
 
     case OPT_m4_nofpu:
@@ -667,62 +668,74 @@ sh_handle_option (struct gcc_options *opts, struct gcc_options *opts_set,
     case OPT_m4_340:
     case OPT_m4_400:
     case OPT_m4_500:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_NOFPU;
       return true;
 
     case OPT_m4_single:
     case OPT_m4_100_single:
     case OPT_m4_200_single:
     case OPT_m4_300_single:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE;
       return true;
 
     case OPT_m4_single_only:
     case OPT_m4_100_single_only:
     case OPT_m4_200_single_only:
     case OPT_m4_300_single_only:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE_ONLY;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4_SINGLE_ONLY;
       return true;
 
     case OPT_m4a:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A;
+      opts->x_target_flags = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A;
       return true;
 
     case OPT_m4a_nofpu:
     case OPT_m4al:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_NOFPU;
       return true;
 
     case OPT_m4a_single:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE;
       return true;
 
     case OPT_m4a_single_only:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE_ONLY;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH4A_SINGLE_ONLY;
       return true;
 
     case OPT_m5_32media:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA;
       return true;
 
     case OPT_m5_32media_nofpu:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_32MEDIA_NOFPU;
       return true;
 
     case OPT_m5_64media:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA;
       return true;
 
     case OPT_m5_64media_nofpu:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_64MEDIA_NOFPU;
       return true;
 
     case OPT_m5_compact:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT;
       return true;
 
     case OPT_m5_compact_nofpu:
-      target_flags = (target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT_NOFPU;
+      opts->x_target_flags
+       = (opts->x_target_flags & ~MASK_ARCH) | SELECT_SH5_COMPACT_NOFPU;
       return true;
 
     default: