]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
rtlanal.c (set_noop_p): Return true for noop jumps.
authorJan Hubicka <jh@suse.cz>
Fri, 20 Jul 2001 20:07:58 +0000 (22:07 +0200)
committerJan Hubicka <hubicka@gcc.gnu.org>
Fri, 20 Jul 2001 20:07:58 +0000 (20:07 +0000)
* rtlanal.c (set_noop_p): Return true for noop jumps.

* expr.c (emit_single_push_insn): Add call to push expander.
* expr.h (optab_index): Add OTI_push
(push_optab): New constant.
* genopinit.c (optabs): Add push_optab.
* optabs.c (init_optab): Init push optab.
* md.texi (push??1): Document

From-SVN: r44210

gcc/ChangeLog
gcc/expr.c
gcc/expr.h
gcc/genopinit.c
gcc/optabs.c
gcc/rtlanal.c

index b73cd6657d1849cb7154706846a2f386b96e9076..8e1ab0674bb1950c65e6a8343288949f02e86bec 100644 (file)
@@ -1,3 +1,14 @@
+Fri Jul 20 21:59:42 CEST 2001  Jan Hubicka  <jh@suse.cz>
+
+       * rtlanal.c (set_noop_p): Return true for noop jumps.
+
+       * expr.c (emit_single_push_insn): Add call to push expander.
+       * expr.h (optab_index): Add OTI_push
+       (push_optab): New constant.
+       * genopinit.c (optabs): Add push_optab.
+       * optabs.c (init_optab): Init push optab.
+       * md.texi (push??1): Document
+
 2001-07-20  Stephane Carrez  <Stephane.Carrez@worldnet.fr>
 
        * config/m68hc11/m68hc11.md ("movdi", "movdi_internal"): Use an
index 041ee908044144a6488edb0855d171c3d03bc3f6..bd60d3f59b96163e13b8557dc413e9305c5fabbd 100644 (file)
@@ -3155,7 +3155,21 @@ emit_single_push_insn (mode, x, type)
   rtx dest_addr;
   unsigned rounded_size = PUSH_ROUNDING (GET_MODE_SIZE (mode));
   rtx dest;
+  enum insn_code icode;
+  insn_operand_predicate_fn pred;
 
+  stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
+  /* If there is push pattern, use it.  Otherwise try old way of throwing
+     MEM representing push operation to move expander.  */
+  icode = push_optab->handlers[(int) mode].insn_code;
+  if (icode != CODE_FOR_nothing)
+    {
+      if (((pred = insn_data[(int) icode].operand[0].predicate)
+         && !((*pred) (x, mode))))
+       x = force_reg (mode, x);
+      emit_insn (GEN_FCN (icode) (x));
+      return;
+    }
   if (GET_MODE_SIZE (mode) == rounded_size)
     dest_addr = gen_rtx_fmt_e (STACK_PUSH_CODE, Pmode, stack_pointer_rtx);
   else
@@ -3172,8 +3186,6 @@ emit_single_push_insn (mode, x, type)
 
   dest = gen_rtx_MEM (mode, dest_addr);
 
-  stack_pointer_delta += PUSH_ROUNDING (GET_MODE_SIZE (mode));
-
   if (type != 0)
     {
       set_mem_attributes (dest, type, 1);
index ed79d99d05bd9057ae7be253137191dff7faafd0..07b1a81101721bf6b91e9979ea8ddab44c5a1604 100644 (file)
@@ -378,6 +378,9 @@ enum optab_index
   OTI_cmov,
   OTI_cstore,
     
+  /* Push instruction.  */
+  OTI_push,
+
   OTI_MAX
 };
 
@@ -437,6 +440,7 @@ extern optab optab_table[OTI_MAX];
 #define cbranch_optab (optab_table[OTI_cbranch])
 #define cmov_optab (optab_table[OTI_cmov])
 #define cstore_optab (optab_table[OTI_cstore])
+#define push_optab (optab_table[OTI_push])
 
 /* Tables of patterns for extending one integer mode to another.  */
 extern enum insn_code extendtab[MAX_MACHINE_MODE][MAX_MACHINE_MODE][2];
index e8b121128658b38e777d63e410e157ca77228eb1..8e00718e2f1312a93b0d2659953ad2c2bba14a9c 100644 (file)
@@ -128,6 +128,7 @@ const char * const optabs[] =
   "cbranch_optab->handlers[$A].insn_code = CODE_FOR_$(cbranch$a4$)",
   "cmov_optab->handlers[$A].insn_code = CODE_FOR_$(cmov$a6$)",
   "cstore_optab->handlers[$A].insn_code = CODE_FOR_$(cstore$a4$)",
+  "push_optab->handlers[$A].insn_code = CODE_FOR_$(push$a1$)",
   "reload_in_optab[$A] = CODE_FOR_$(reload_in$a$)",
   "reload_out_optab[$A] = CODE_FOR_$(reload_out$a$)",
   "movstr_optab[$A] = CODE_FOR_$(movstr$a$)",
index f135ad1876518a51945e607d6813b50d35004307..84cf56dead973cdd2b1a1e54473e3220a8ea7420 100644 (file)
@@ -4682,6 +4682,7 @@ init_optabs ()
   cbranch_optab = init_optab (UNKNOWN);
   cmov_optab = init_optab (UNKNOWN);
   cstore_optab = init_optab (UNKNOWN);
+  push_optab = init_optab (UNKNOWN);
 
   for (i = 0; i < NUM_MACHINE_MODES; i++)
     {
index 90562efab6a81e76b892e59db1fd0d0394eb0eef..2f9696cc1fc377b8b2c51017deb9e72e7943fa28 100644 (file)
@@ -998,6 +998,9 @@ set_noop_p (set)
   if (GET_CODE (dst) == MEM && GET_CODE (src) == MEM)
     return rtx_equal_p (dst, src);
 
+  if (dst == pc_rtx && src == pc_rtx)
+    return 1;
+
   if (GET_CODE (dst) == SIGN_EXTRACT
       || GET_CODE (dst) == ZERO_EXTRACT)
     return rtx_equal_p (XEXP (dst, 0), src)