rtl.c (currently_expanding_to_rtl): New.
authorSteven Bosscher <stevenb@suse.de>
Thu, 29 Jul 2004 07:37:16 +0000 (07:37 +0000)
committerSteven Bosscher <steven@gcc.gnu.org>
Thu, 29 Jul 2004 07:37:16 +0000 (07:37 +0000)
* rtl.c (currently_expanding_to_rtl): New.
* rtl.h (currently_expanding_to_rtl): Export it.
* cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.

* config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
inliner hack.
* config/sh/sh.c: Replace rtx_equal_function_value_matters
with currently_expanding_to_rtl.
* config/sh/sh.md: Likewise.
* config/ia64/ia64.c (got_symbolic_operand): Likewise.

From-SVN: r85287

gcc/ChangeLog
gcc/cfgexpand.c
gcc/config/alpha/alpha.c
gcc/config/ia64/ia64.c
gcc/config/sh/sh.c
gcc/config/sh/sh.md
gcc/rtl.c
gcc/rtl.h

index 12ae194fe3ad3668120938316b03207b86e7452a..9c5b5237ad60a94e459b377a354a1afdac4820eb 100644 (file)
@@ -1,3 +1,16 @@
+2004-07-29  Steven Bosscher  <stevenb@suse.de>
+
+       * rtl.c (currently_expanding_to_rtl): New.
+       * rtl.h (currently_expanding_to_rtl): Export it.
+       * cfgexpand.c (tree_cfg_expand): Set/clear it at entry/exit.
+
+       * config/alpha/alpha.c (alpha_expand_mov): Remove old RTL
+       inliner hack.
+       * config/sh/sh.c: Replace rtx_equal_function_value_matters
+       with currently_expanding_to_rtl.
+       * config/sh/sh.md: Likewise.
+       * config/ia64/ia64.c (got_symbolic_operand): Likewise.
+
 2004-07-29  Alexandre Oliva  <aoliva@redhat.com>
 
        Introduce sh2a support.
index db9206ee56f76f554f65512720609fe5174ce0da..aa5911890eef231a04977f81c7c2162c517a3dac 100644 (file)
@@ -433,6 +433,9 @@ tree_expand_cfg (void)
               IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (current_function_decl)));
     }
 
+  /* Some backends want to know that we are expanding to RTL.  */
+  currently_expanding_to_rtl = 1;
+
   /* Prepare the rtl middle end to start recording block changes.  */
   reset_block_changes ();
 
@@ -459,6 +462,9 @@ tree_expand_cfg (void)
 
   construct_exit_block ();
 
+  /* We're done expanding trees to RTL.  */
+  currently_expanding_to_rtl = 0;
+
   /* Convert from NOTE_INSN_EH_REGION style notes, and do other
      sorts of eh initialization.  Delay this until after the
      initial rtl dump so that we can see the original nesting.  */
index d195cab1d25c460a1673ec447c90794fb6e2a930..02bfb722b10d70f442930cabbcd08637b5a6d6e1 100644 (file)
@@ -2796,23 +2796,6 @@ alpha_expand_mov (enum machine_mode mode, rtx *operands)
     {
       rtx tmp;
 
-      /* With RTL inlining, at -O3, rtl is generated, stored, then actually
-        compiled at the end of compilation.  In the meantime, someone can
-        re-encode-section-info on some symbol changing it e.g. from global
-        to local-not-small.  If this happens, we'd have emitted a plain
-        load rather than a high+losum load and not recognize the insn.
-
-        So if rtl inlining is in effect, we delay the global/not-global
-        decision until rest_of_compilation by wrapping it in an
-        UNSPEC_SYMBOL.  */
-      if (TARGET_EXPLICIT_RELOCS && flag_inline_functions
-         && rtx_equal_function_value_matters
-         && global_symbolic_operand (operands[1], mode))
-       {
-         emit_insn (gen_movdi_er_maybe_g (operands[0], operands[1]));
-         return true;
-       }
-
       tmp = alpha_legitimize_address (operands[1], operands[0], mode);
       if (tmp)
        {
index 2899c0f611f00f4e84f6cf4798c74f5a453394de..aa0dc20c26808660155e41aec466ce880787a55f 100644 (file)
@@ -489,7 +489,7 @@ got_symbolic_operand (rtx op, enum machine_mode mode ATTRIBUTE_UNUSED)
       /* "Ok" while emitting rtl, since otherwise we won't be provided
         with the entire offset during emission, which makes it very
         hard to split the offset into high and low parts.  */
-      if (rtx_equal_function_value_matters)
+      if (currently_expanding_to_rtl)
        return 1;
 
       /* Force the low 14 bits of the constant to zero so that we do not
index b2c01302778129d25e8edf29bf41a93c6ef3ff23..7eef57ab2386af9d117bdd4e382a6b5250188fc0 100644 (file)
@@ -2286,9 +2286,6 @@ shl_and_scr_length (rtx insn)
   return len + shift_insns[INTVAL (XEXP (op, 1))];
 }
 
-/* Generating rtl? */
-extern int rtx_equal_function_value_matters;
-
 /* Generate rtl for instructions for which shl_and_kind advised a particular
    method of generating them, i.e. returned zero.  */
 
@@ -2359,7 +2356,7 @@ gen_shl_and (rtx dest, rtx left_rtx, rtx mask_rtx, rtx source)
     case 2:
       /* Don't expand fine-grained when combining, because that will
          make the pattern fail.  */
-      if (rtx_equal_function_value_matters
+      if (currently_expanding_to_rtl
          || reload_in_progress || reload_completed)
        {
          rtx operands[3];
@@ -2556,7 +2553,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
 
        /* Don't expand fine-grained when combining, because that will
           make the pattern fail.  */
-       if (! rtx_equal_function_value_matters
+       if (! currently_expanding_to_rtl
            && ! reload_in_progress && ! reload_completed)
          {
            emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
@@ -2611,7 +2608,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
     case 5:
       {
        int i = 16 - size;
-       if (! rtx_equal_function_value_matters
+       if (! currently_expanding_to_rtl
            && ! reload_in_progress && ! reload_completed)
          emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
        else
@@ -2630,7 +2627,7 @@ gen_shl_sext (rtx dest, rtx left_rtx, rtx size_rtx, rtx source)
     case 7:
       /* Don't expand fine-grained when combining, because that will
         make the pattern fail.  */
-      if (! rtx_equal_function_value_matters
+      if (! currently_expanding_to_rtl
          && ! reload_in_progress && ! reload_completed)
        {
          emit_insn (gen_shl_sext_ext (dest, source, left_rtx, size_rtx));
index e825fae614b8b3e4eb92160f25a000e84c08a967..8b2c6f2bb96d6fc8ae314575cc9519481e4e4c56 100644 (file)
        (unspec:SI [(match_operand 1 "register_operand" "")] UNSPEC_RA))]
   "TARGET_SH1"
   "#"
-  "&& ! rtx_equal_function_value_matters"
+  "&& ! currently_expanding_to_rtl"
   [(set (match_dup 0) (match_dup 1))]
   "
 {
@@ -7476,7 +7476,7 @@ mov.l\\t1f,r0\\n\\
     }
   if (sh_expand_t_scc (EQ, operands[0]))
     DONE;
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (EQ);
 }")
@@ -7524,7 +7524,7 @@ mov.l\\t1f,r0\\n\\
        }
       DONE;
     }
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (LT);
 }")
@@ -7628,7 +7628,7 @@ mov.l\\t1f,r0\\n\\
        }
       DONE;
     }
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (GT);
 }")
@@ -7682,7 +7682,7 @@ mov.l\\t1f,r0\\n\\
       DONE;
     }
 
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   if (GET_MODE_CLASS (GET_MODE (sh_compare_op0)) == MODE_FLOAT)
     {
@@ -7723,7 +7723,7 @@ mov.l\\t1f,r0\\n\\
                                     sh_compare_op0, sh_compare_op1));
       DONE;
     }
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (GTU);
 }")
@@ -7749,7 +7749,7 @@ mov.l\\t1f,r0\\n\\
                                     sh_compare_op1, sh_compare_op0));
       DONE;
     }
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (LTU);
 }")
@@ -7780,7 +7780,7 @@ mov.l\\t1f,r0\\n\\
 
       DONE;
     }
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (LEU);
 }")
@@ -7812,7 +7812,7 @@ mov.l\\t1f,r0\\n\\
       DONE;
     }
 
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (GEU);
 }")
@@ -7863,7 +7863,7 @@ mov.l\\t1f,r0\\n\\
 
   if (sh_expand_t_scc (NE, operands[0]))
     DONE;
-  if (! rtx_equal_function_value_matters)
+  if (! currently_expanding_to_rtl)
     FAIL;
   operands[1] = prepare_scc_operands (EQ);
   operands[2] = gen_reg_rtx (SImode);
index 74c85351abeef051f342aa659a9517fe7128c5a7..7de4b90e671d2b20d882c78f2fdd74adcd502e06 100644 (file)
--- a/gcc/rtl.c
+++ b/gcc/rtl.c
@@ -320,6 +320,10 @@ shallow_copy_rtx_stat (rtx orig MEM_STAT_DECL)
 \f
 /* Nonzero when we are generating CONCATs.  */
 int generating_concat_p;
+
+/* Nonzero when we are expanding trees to RTL.  */
+int currently_expanding_to_rtl;
+
 \f
 /* Return 1 if X and Y are identical-looking rtx's.
    This is the Lisp function EQUAL for rtx arguments.  */
index 965650f5788e244d5d6c24615d698909bf246e52..06a553e555cf5b7ceddda605707a991102c3a2eb 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -1543,6 +1543,9 @@ do {                                              \
 /* Nonzero when we are generating CONCATs.  */
 extern int generating_concat_p;
 
+/* Nonzero when we are expanding trees to RTL.  */
+extern int currently_expanding_to_rtl;
+
 /* Generally useful functions.  */
 
 /* In expmed.c */