opth-gen.awk (target_flags_explicit): Declare.
authorRichard Sandiford <rsandifo@nildram.co.uk>
Sun, 23 Sep 2007 19:18:27 +0000 (19:18 +0000)
committerRichard Sandiford <rsandifo@gcc.gnu.org>
Sun, 23 Sep 2007 19:18:27 +0000 (19:18 +0000)
gcc/
* opth-gen.awk (target_flags_explicit): Declare.
* toplev.h (target_flags_explicit): Delete declaration.
* toplev.c (target_flags): Likewise.
* config/mips/mips.h (mips_llsc_setting, mips_llsc): Delete.
(GENERATE_SYNC, GENERATE_LL_SC): Redefine using target_explicit_flags.
Never return true for TARGET_MIPS16.
* config/mips/mips.c (mips_llsc): Delete.
(mips_handle_option): Remove -mllsc handling.
(mips_strip_unspec_address): Tweak comment.
* config/mips/mips.opt (mllsc): Use a target mask.

gcc/testsuite/
* gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Don't expect
any of the macros to be defined for __mips16.
* gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise.

From-SVN: r128699

gcc/ChangeLog
gcc/config/mips/mips.c
gcc/config/mips/mips.h
gcc/config/mips/mips.opt
gcc/opth-gen.awk
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-1.c
gcc/testsuite/gcc.target/mips/gcc-have-sync-compare-and-swap-2.c
gcc/toplev.c
gcc/toplev.h

index 7dcbf7238b2272da51df95dae19a978e27f340ea..639dc8e1b34b847be9e120cde26da27c1f1eab43 100644 (file)
@@ -1,3 +1,16 @@
+2007-09-23  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * opth-gen.awk (target_flags_explicit): Declare.
+       * toplev.h (target_flags_explicit): Delete declaration.
+       * toplev.c (target_flags): Likewise.
+       * config/mips/mips.h (mips_llsc_setting, mips_llsc): Delete.
+       (GENERATE_SYNC, GENERATE_LL_SC): Redefine using target_explicit_flags.
+       Never return true for TARGET_MIPS16.
+       * config/mips/mips.c (mips_llsc): Delete.
+       (mips_handle_option): Remove -mllsc handling.
+       (mips_strip_unspec_address): Tweak comment.
+       * config/mips/mips.opt (mllsc): Use a target mask.
+
 2007-09-23  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * doc/tm.texi (POINTERS_EXTEND_UNSIGNED): Document extensions to
index 5e939d1ad2f7b1cc4d25b7faadc76f183f48da5e..e6b17a5f08c701e4e7dac4dad91799168099d99f 100644 (file)
@@ -638,9 +638,6 @@ static GTY(()) int mips16_flipper;
 /* The -mtext-loads setting.  */
 enum mips_code_readable_setting mips_code_readable = CODE_READABLE_YES;
 
-/* The -mllsc setting.  */
-enum mips_llsc_setting mips_llsc = LLSC_DEFAULT;
-
 /* The architecture selected by -mipsN.  */
 static const struct mips_cpu_info *mips_isa_info;
 
@@ -5872,7 +5869,7 @@ mips_set_current_function (tree fndecl)
 /* Implement TARGET_HANDLE_OPTION.  */
 
 static bool
-mips_handle_option (size_t code, const char *arg, int value)
+mips_handle_option (size_t code, const char *arg, int value ATTRIBUTE_UNUSED)
 {
   switch (code)
     {
@@ -5914,10 +5911,6 @@ mips_handle_option (size_t code, const char *arg, int value)
        return false;
       return true;
 
-    case OPT_mllsc:
-      mips_llsc = value ? LLSC_YES : LLSC_NO;
-      return true;
-
     default:
       return true;
     }
@@ -6545,8 +6538,7 @@ mips_strip_unspec_address (rtx op)
    '$' Print the name of the stack pointer register (sp or $29).
    '+' Print the name of the gp register (usually gp or $28).
    '~' Output a branch alignment to LABEL_ALIGN(NULL).
-   '|'  Print .set push; .set mips2 if mips_llsc == LLSC_YES
-        && !ISA_HAS_LL_SC.
+   '|'  Print .set push; .set mips2 if !ISA_HAS_LL_SC.
    '-'  Print .set pop under the same conditions for '|'.  */
 
 void
index 169779ce1ee22d838a4f296bb61b421e5784c8eb..d401d551a4790ca7e62ca90c5008bc89ac3aed9c 100644 (file)
@@ -121,14 +121,6 @@ enum mips_code_readable_setting {
   CODE_READABLE_YES
 };
 
-
-/* Enumerates the setting of the -mllsc option.  */
-enum mips_llsc_setting {
-  LLSC_DEFAULT,
-  LLSC_NO,
-  LLSC_YES
-};
-
 #ifndef USED_FOR_TARGET
 extern char mips_print_operand_punct[256]; /* print_operand punctuation chars */
 extern const char *current_function_file; /* filename current function is in */
@@ -153,7 +145,6 @@ extern const struct mips_cpu_info *mips_arch_info;
 extern const struct mips_cpu_info *mips_tune_info;
 extern const struct mips_rtx_cost_data *mips_cost;
 extern enum mips_code_readable_setting mips_code_readable;
-extern enum mips_llsc_setting mips_llsc;
 #endif
 
 /* Macros to silence warnings about numbers being signed in traditional
@@ -920,15 +911,19 @@ extern enum mips_llsc_setting mips_llsc;
 
 /* ISA includes sync.  */
 #define ISA_HAS_SYNC ((mips_isa >= 2 || TARGET_MIPS3900) && !TARGET_MIPS16)
-#define GENERATE_SYNC (mips_llsc == LLSC_YES \
-                      || (mips_llsc == LLSC_DEFAULT && ISA_HAS_SYNC))
+#define GENERATE_SYNC                  \
+  (target_flags_explicit & MASK_LLSC   \
+   ? TARGET_LLSC && !TARGET_MIPS16     \
+   : ISA_HAS_SYNC)
 
 /* ISA includes ll and sc.  Note that this implies ISA_HAS_SYNC
    because the expanders use both ISA_HAS_SYNC and ISA_HAS_LL_SC
    instructions.  */
 #define ISA_HAS_LL_SC (mips_isa >= 2 && !TARGET_MIPS16)
-#define GENERATE_LL_SC (mips_llsc == LLSC_YES \
-                       || (mips_llsc == LLSC_DEFAULT && ISA_HAS_LL_SC))
+#define GENERATE_LL_SC                 \
+  (target_flags_explicit & MASK_LLSC   \
+   ? TARGET_LLSC && !TARGET_MIPS16     \
+   : ISA_HAS_LL_SC)
 \f
 /* Add -G xx support.  */
 
index 05aedda1428ba7e2045abd4909cd435cc2ba6e0d..3a19d0af160e928ae6a8fc52d1e29c7e6b0c2c44 100644 (file)
@@ -181,7 +181,7 @@ Target Report RejectNegative Mask(MIPS3D)
 Use MIPS-3D instructions
 
 mllsc
-Target Report
+Target Report Mask(LLSC)
 Use ll, sc and sync instructions
 
 mlocal-sdata
index 20269501a383f4cf637107af3636607cab28b3c4..dbd019191b6b25b9414b444190959c184904f875 100644 (file)
@@ -61,6 +61,7 @@ print "#ifndef OPTIONS_H"
 print "#define OPTIONS_H"
 print ""
 print "extern int target_flags;"
+print "extern int target_flags_explicit;"
 print ""
 
 for (i = 0; i < n_opts; i++) {
index 4a0fb6d5ba6fef6db2d7b98daa77897962dd0dc2..ff03ded25b7374d98fa3ca68cb55e39bb28cab02 100644 (file)
@@ -1,3 +1,9 @@
+2007-09-23  Richard Sandiford  <rsandifo@nildram.co.uk>
+
+       * gcc.target/mips/gcc-have-sync-compare-and-swap-1.c: Don't expect
+       any of the macros to be defined for __mips16.
+       * gcc.target/mips/gcc-have-sync-compare-and-swap-2.c: Likewise.
+
 2007-09-23  Richard Sandiford  <rsandifo@nildram.co.uk>
 
        * gcc.dg/vect/pr21591.c: Require vect_int.
index b1c524bcb8689a3a3a90eeddd3668f4d5ead5e0f..72eff4da37c3b7a28f8f5c5404caf1b407a4a377 100644 (file)
@@ -9,7 +9,7 @@
 #error nonono
 #endif
 
-#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) == defined (__mips16)
 #error nonono
 #endif
 
index 25cd6732e08a6ba5565290b197d3e992f599fa9f..fed2b38a57f0348234325b527974ccd67dc1def0 100644 (file)
@@ -9,11 +9,11 @@
 #error nonono
 #endif
 
-#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_4
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4) == defined (__mips16)
 #error nonono
 #endif
 
-#ifndef __GCC_HAVE_SYNC_COMPARE_AND_SWAP_8
+#if defined (__GCC_HAVE_SYNC_COMPARE_AND_SWAP_8) == defined (__mips16)
 #error nonono
 #endif
 
index 0c4b63840baea8a04b613fcb2969a5ff13dc0c60..8c6a68a6522750836b8f0a7e25e288a172e00849 100644 (file)
@@ -173,12 +173,6 @@ const char *dump_base_name;
 
 const char *aux_base_name;
 
-/* Bit flags that specify the machine subtype we are compiling for.
-   Bits are tested using macros TARGET_... defined in the tm.h file
-   and set by `-m...' switches.  Must be defined in rtlanal.c.  */
-
-extern int target_flags;
-
 /* A mask of target_flags that includes bit X if X was set or cleared
    on the command line.  */
 
index 749cf308a9690aa765ce8362a5f77562e92ebbe3..26a085d0c842963b697ac49113e1ca142c77ac6b 100644 (file)
@@ -113,8 +113,6 @@ extern const char *aux_info_file_name;
 extern const char *asm_file_name;
 extern bool exit_after_options;
 
-extern int target_flags_explicit;
-
 /* True if the user has tagged the function with the 'section'
    attribute.  */