Removal of -fforce-mem.
authorFariborz Jahanian <fjahanian@apple.com>
Wed, 6 Jul 2005 21:08:02 +0000 (21:08 +0000)
committerFariborz Jahanian <fjahanian@gcc.gnu.org>
Wed, 6 Jul 2005 21:08:02 +0000 (21:08 +0000)
OKed by Richard Henderson.

From-SVN: r101666

gcc/ChangeLog
gcc/doc/invoke.texi
gcc/dojump.c
gcc/expmed.c
gcc/expr.c
gcc/optabs.c
gcc/opts.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/20030324-1.c
gcc/testsuite/gcc.dg/980816-1.c

index 396befc69afc7ceea236607c4f753c33c0873771..a75e4d4f847f8fe5532a4302c53684a129e8ccd8 100644 (file)
@@ -1,3 +1,17 @@
+2005-07-06  Fariborz Jahanian <fjahanian@apple.com>
+
+        * doc/invoke.texi: Update -fforce-mem documentation.
+        * dojump.c (compare_from_rtx,do_compare_rtx_and_jump): Remove 
+        code for -fforce-mem.
+        * expmed.c: (store_bit_field,store_fixed_bit_field,
+        extract_bit_field): Ditto.
+        * expr.c: (convert_move): Ditto.
+        * optabs.c: (expand_binop,expand_twoval_unop,expand_twoval_binop,
+        expand_unop,emit_unop_insn,prepare_cmp_insn,emit_conditional_move,
+        emit_conditional_add,expand_float,expand_fix): Ditto.
+        * opts.c: (decode_options): Remove setting of flag_force_mem flag.
+        (common_handle_option): Issue warning when -fforce-mem specified.
+
 2005-07-06  Paul Brook  <paul@codesourcery.com>
 
        * aclocal.m4: Work around a bug in AC_PATH_PROGS when its last
index a979900ac52e392260e435861afe9d6384048c41..f1ce356d0d5f7a7df14af3cfe1d1c3c9df2ab5fb 100644 (file)
@@ -102,7 +102,7 @@ of the same kind; for example, if you specify @option{-L} more than once,
 the directories are searched in the order specified.
 
 Many options have long names starting with @samp{-f} or with
-@samp{-W}---for example, @option{-fforce-mem},
+@samp{-W}---for example, 
 @option{-fstrength-reduce}, @option{-Wformat} and so on.  Most of
 these have both positive and negative forms; the negative form of
 @option{-ffoo} would be @option{-fno-foo}.  This manual documents
@@ -302,7 +302,7 @@ Objective-C and Objective-C++ Dialects}.
 -fcse-skip-blocks  -fcx-limited-range  -fdata-sections @gol
 -fdelayed-branch  -fdelete-null-pointer-checks -fearly-inlining @gol
 -fexpensive-optimizations  -ffast-math  -ffloat-store @gol
--fforce-addr  -fforce-mem  -ffunction-sections @gol
+-fforce-addr  -ffunction-sections @gol
 -fgcse  -fgcse-lm  -fgcse-sm  -fgcse-las  -fgcse-after-reload @gol
 -floop-optimize -fcrossjumping  -fif-conversion  -fif-conversion2 @gol
 -finline-functions  -finline-limit=@var{n}  -fkeep-inline-functions @gol
@@ -4322,7 +4322,6 @@ also turns on the following optimization flags:
 -fstrength-reduce @gol
 -frerun-cse-after-loop  -frerun-loop-opt @gol
 -fcaller-saves @gol
--fforce-mem @gol
 -fpeephole2 @gol
 -fschedule-insns  -fschedule-insns2 @gol
 -fsched-interblock  -fsched-spec @gol
@@ -4399,15 +4398,12 @@ Force memory operands to be copied into registers before doing
 arithmetic on them.  This produces better code by making all memory
 references potential common subexpressions.  When they are not common
 subexpressions, instruction combination should eliminate the separate
-register-load.
-
-Enabled at levels @option{-O2}, @option{-O3}, @option{-Os}.
+register-load. This option is now a nop and will be removed in 4.2.
 
 @item -fforce-addr
 @opindex fforce-addr
 Force memory address constants to be copied into registers before
-doing arithmetic on them.  This may produce better code just as
-@option{-fforce-mem} may.
+doing arithmetic on them.
 
 @item -fomit-frame-pointer
 @opindex fomit-frame-pointer
index c955f5d5fb39f9009951b56046847086436e770b..741c30a8dca7f7f797cd33ea9ffea90b64a2fe11 100644 (file)
@@ -761,12 +761,6 @@ compare_from_rtx (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
       code = swap_condition (code);
     }
 
-  if (flag_force_mem)
-    {
-      op0 = force_not_mem (op0);
-      op1 = force_not_mem (op1);
-    }
-
   do_pending_stack_adjust ();
 
   code = unsignedp ? unsigned_condition (code) : code;
@@ -830,12 +824,6 @@ do_compare_rtx_and_jump (rtx op0, rtx op1, enum rtx_code code, int unsignedp,
       code = swap_condition (code);
     }
 
-  if (flag_force_mem)
-    {
-      op0 = force_not_mem (op0);
-      op1 = force_not_mem (op1);
-    }
-
   do_pending_stack_adjust ();
 
   code = unsignedp ? unsigned_condition (code) : code;
index f6f35b91c77b39ae4878636f567fdf484c73fa49..e54f0430cf578a73b6129a8abaf0464a76733c85 100644 (file)
@@ -408,14 +408,6 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
        }
     }
 
-  if (flag_force_mem)
-    {
-      int old_generating_concat_p = generating_concat_p;
-      generating_concat_p = 0;
-      value = force_not_mem (value);
-      generating_concat_p = old_generating_concat_p;
-    }
-
   /* If the target is a register, overwriting the entire object, or storing
      a full-word or multi-word field can be done with just a SUBREG.
 
@@ -633,8 +625,6 @@ store_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
 
       /* If this machine's insv can only insert into a register, copy OP0
         into a register and save it back later.  */
-      /* This used to check flag_force_mem, but that was a serious
-        de-optimization now that flag_force_mem is enabled by -O2.  */
       if (MEM_P (op0)
          && ! ((*insn_data[(int) CODE_FOR_insv].operand[0].predicate)
                (op0, VOIDmode)))
@@ -902,7 +892,7 @@ store_fixed_bit_field (rtx op0, unsigned HOST_WIDE_INT offset,
   /* Now clear the chosen bits in OP0,
      except that if VALUE is -1 we need not bother.  */
 
-  subtarget = (REG_P (op0) || ! flag_force_mem) ? op0 : 0;
+  subtarget = op0;
 
   if (! all_one)
     {
@@ -1449,8 +1439,7 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
 
          unit = GET_MODE_BITSIZE (maxmode);
 
-         if (xtarget == 0
-             || (flag_force_mem && MEM_P (xtarget)))
+         if (xtarget == 0)
            xtarget = xspec_target = gen_reg_rtx (tmode);
 
          if (GET_MODE (xtarget) != maxmode)
@@ -1577,8 +1566,7 @@ extract_bit_field (rtx str_rtx, unsigned HOST_WIDE_INT bitsize,
 
          unit = GET_MODE_BITSIZE (maxmode);
 
-         if (xtarget == 0
-             || (flag_force_mem && MEM_P (xtarget)))
+         if (xtarget == 0)
            xtarget = xspec_target = gen_reg_rtx (tmode);
 
          if (GET_MODE (xtarget) != maxmode)
index a3c1b6ad9174fb1078298d32dfb03bb7413ac3df..2a1ecab51e8612ba4b000361f023d11cba83cdee 100644 (file)
@@ -642,9 +642,6 @@ convert_move (rtx to, rtx from, int unsignedp)
       if ((code = can_extend_p (to_mode, from_mode, unsignedp))
          != CODE_FOR_nothing)
        {
-         if (flag_force_mem)
-           from = force_not_mem (from);
-
          emit_unop_insn (code, to, from, equiv_code);
          return;
        }
index 2ed499e441fd63aeef4265bf95e2ea5eb5daeff0..60c491870a88f9866098ee8a7279cdabcf426b43 100644 (file)
@@ -1030,21 +1030,6 @@ expand_binop (enum machine_mode mode, optab binoptab, rtx op0, rtx op1,
 
   class = GET_MODE_CLASS (mode);
 
-  if (flag_force_mem)
-    {
-      /* Load duplicate non-volatile operands once.  */
-      if (rtx_equal_p (op0, op1) && ! volatile_refs_p (op0))
-       {
-         op0 = force_not_mem (op0);
-         op1 = op0;
-       }
-      else
-       {
-         op0 = force_not_mem (op0);
-         op1 = force_not_mem (op1);
-       }
-    }
-
   /* If subtracting an integer constant, convert this into an addition of
      the negated constant.  */
 
@@ -1871,9 +1856,6 @@ expand_twoval_unop (optab unoptab, rtx op0, rtx targ0, rtx targ1,
 
   class = GET_MODE_CLASS (mode);
 
-  if (flag_force_mem)
-    op0 = force_not_mem (op0);
-
   if (!targ0)
     targ0 = gen_reg_rtx (mode);
   if (!targ1)
@@ -1966,12 +1948,6 @@ expand_twoval_binop (optab binoptab, rtx op0, rtx op1, rtx targ0, rtx targ1,
 
   class = GET_MODE_CLASS (mode);
 
-  if (flag_force_mem)
-    {
-      op0 = force_not_mem (op0);
-      op1 = force_not_mem (op1);
-    }
-
   /* If we are inside an appropriately-short loop and we are optimizing,
      force expensive constants into a register.  */
   if (CONSTANT_P (op0) && optimize
@@ -2358,9 +2334,6 @@ expand_unop (enum machine_mode mode, optab unoptab, rtx op0, rtx target,
 
   class = GET_MODE_CLASS (mode);
 
-  if (flag_force_mem)
-    op0 = force_not_mem (op0);
-
   if (unoptab->handlers[(int) mode].insn_code != CODE_FOR_nothing)
     {
       int icode = (int) unoptab->handlers[(int) mode].insn_code;
@@ -2987,19 +2960,12 @@ emit_unop_insn (int icode, rtx target, rtx op0, enum rtx_code code)
 
   temp = target;
 
-  /* Sign and zero extension from memory is often done specially on
-     RISC machines, so forcing into a register here can pessimize
-     code.  */
-  if (flag_force_mem && code != SIGN_EXTEND && code != ZERO_EXTEND)
-    op0 = force_not_mem (op0);
-
   /* Now, if insn does not accept our operands, put them into pseudos.  */
 
   if (!insn_data[icode].operand[1].predicate (op0, mode0))
     op0 = copy_to_mode_reg (mode0, op0);
 
-  if (!insn_data[icode].operand[0].predicate (temp, GET_MODE (temp))
-      || (flag_force_mem && MEM_P (temp)))
+  if (!insn_data[icode].operand[0].predicate (temp, GET_MODE (temp)))
     temp = gen_reg_rtx (GET_MODE (temp));
 
   pat = GEN_FCN (icode) (temp, op0);
@@ -3415,21 +3381,6 @@ prepare_cmp_insn (rtx *px, rtx *py, enum rtx_code *pcomparison, rtx size,
 
   class = GET_MODE_CLASS (mode);
 
-  if (mode != BLKmode && flag_force_mem)
-    {
-      /* Load duplicate non-volatile operands once.  */
-      if (rtx_equal_p (x, y) && ! volatile_refs_p (x))
-       {
-         x = force_not_mem (x);
-         y = x;
-       }
-      else
-       {
-         x = force_not_mem (x);
-         y = force_not_mem (y);
-       }
-    }
-
   /* If we are inside an appropriately-short loop and we are optimizing,
      force expensive constants into a register.  */
   if (CONSTANT_P (x) && optimize
@@ -3916,12 +3867,6 @@ emit_conditional_move (rtx target, enum rtx_code code, rtx op0, rtx op1,
   if (icode == CODE_FOR_nothing)
     return 0;
 
-  if (flag_force_mem)
-    {
-      op2 = force_not_mem (op2);
-      op3 = force_not_mem (op3);
-    }
-
   if (!target)
     target = gen_reg_rtx (mode);
 
@@ -4050,12 +3995,6 @@ emit_conditional_add (rtx target, enum rtx_code code, rtx op0, rtx op1,
   if (icode == CODE_FOR_nothing)
     return 0;
 
-  if (flag_force_mem)
-    {
-      op2 = force_not_mem (op2);
-      op3 = force_not_mem (op3);
-    }
-
   if (!target)
     target = gen_reg_rtx (mode);
 
@@ -4379,9 +4318,6 @@ expand_float (rtx to, rtx from, int unsignedp)
       rtx temp;
       REAL_VALUE_TYPE offset;
 
-      if (flag_force_mem)
-       from = force_not_mem (from);
-
       /* Look for a usable floating mode FMODE wider than the source and at
         least as wide as the target.  Using FMODE will avoid rounding woes
         with unsigned values greater than the signed maximum value.  */
@@ -4489,9 +4425,6 @@ expand_float (rtx to, rtx from, int unsignedp)
       if (GET_MODE_SIZE (GET_MODE (from)) < GET_MODE_SIZE (SImode))
        from = convert_to_mode (SImode, from, unsignedp);
 
-      if (flag_force_mem)
-       from = force_not_mem (from);
-
       libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
       gcc_assert (libfunc);
 
@@ -4609,9 +4542,6 @@ expand_fix (rtx to, rtx from, int unsignedp)
          lab1 = gen_label_rtx ();
          lab2 = gen_label_rtx ();
 
-         if (flag_force_mem)
-           from = force_not_mem (from);
-
          if (fmode != GET_MODE (from))
            from = convert_to_mode (fmode, from, 0);
 
@@ -4678,9 +4608,6 @@ expand_fix (rtx to, rtx from, int unsignedp)
       libfunc = tab->handlers[GET_MODE (to)][GET_MODE (from)].libfunc;
       gcc_assert (libfunc);
 
-      if (flag_force_mem)
-       from = force_not_mem (from);
-
       start_sequence ();
 
       value = emit_library_call_value (libfunc, NULL_RTX, LCT_CONST,
index 195626fa264ad7c6f95c8ecf513aa948f3fd84df..e5e490d16eb4dcb62fb809e35f10e78827ec8637 100644 (file)
@@ -560,7 +560,6 @@ decode_options (unsigned int argc, const char **argv)
       flag_rerun_cse_after_loop = 1;
       flag_rerun_loop_opt = 1;
       flag_caller_saves = 1;
-      flag_force_mem = 1;
       flag_peephole2 = 1;
 #ifdef INSN_SCHEDULING
       flag_schedule_insns = 1;
@@ -1042,6 +1041,10 @@ common_handle_option (size_t scode, const char *arg, int value)
       flag_pedantic_errors = pedantic = 1;
       break;
 
+    case OPT_fforce_mem:
+      warning (0, "-f[no-]force-mem is nop and option will be removed in 4.2");
+      break;
+
     default:
       /* If the flag was handled in a standard way, assume the lack of
         processing here is intentional.  */
index b70b33024a93896540ae04e5414de672843cca35..445ac810b40194d3a6a74deb589f7c501a323e75 100644 (file)
@@ -1,3 +1,8 @@
+2005-07-06  Fariborz Jahanian <fjahanian@apple.com>
+
+       * gcc.dg/20030324-1.c: Remove -fforce-mem option.
+       * gcc.dg/980816-1.c: Ditto.
+
 2005-07-06  Jeff Law  <law@redhat.com>
 
        * gcc.c-torture/compile/pr21356.c: New test.
index 7e46d040ee2b387066b50a7441bf9a3a5b1af7b2..f141bafa927ea283aca89583597c3eeabf45e10c 100644 (file)
@@ -1,5 +1,5 @@
 /* { dg-do run } */
-/* { dg-options "-O -fstrength-reduce -fstrict-aliasing -fforce-mem -fgcse" } */
+/* { dg-options "-O -fstrength-reduce -fstrict-aliasing -fgcse" } */
 
 /* PR optimization/10087 */
 /* Contributed by Peter van Hoof <p.van-hoof@qub.ac.uk> */
index 8581d999dbd64a74631a8bbbc23e939155742c8e..d4f59c40c538be32f4a5fb14c711effc9fbcf8a8 100644 (file)
@@ -1,5 +1,4 @@
 /* { dg-do compile } */
-/* { dg-options -fno-force-mem } */
 
 int
 div_and_round_double (lden_orig, hden_orig)